How to change currency symbol in windows

This forum is for eXpress++ general support.
Message
Author
User avatar
unixkd
Posts: 623
Joined: Thu Feb 11, 2010 1:39 pm

How to change currency symbol in windows

#1 Post by unixkd »

Hi all

How can I programmatically change the currency symbol at runtime using either dc_regquery/dc_regwrite() or winapi functions.

Thanks

Joe

User avatar
Tom
Posts: 1288
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: How to change currency symbol in windows

#2 Post by Tom »

Hi, Joe.

The currency symbol is set at HKCU\Control Panel\International -> "sCurrency". Just write a different symbol to the reg variable, done. You know how to use DC_RegWrite() for this?

If you want to set it just for a session, "SetLocalInfoA" (KERNEL32.DLL) is the API-function to use.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
unixkd
Posts: 623
Joined: Thu Feb 11, 2010 1:39 pm

Re: How to change currency symbol in windows

#3 Post by unixkd »

Hi Tom

Great !!!

I appreciate

Joe

User avatar
unixkd
Posts: 623
Joined: Thu Feb 11, 2010 1:39 pm

Re: How to change currency symbol in windows

#4 Post by unixkd »

Hi all

I got the dc_regquerry() and dc_regwrite() working. Now I have one problem some currency symbols have decimal code outside the range 0 to 255 and therefore cannot be copied to the program or saved into database. Like Korea won and Nigeria Naira for example has decimal code 8358. They also have hexadecimal codes. Is there a function similar to chr() that can convert the hexadecimal codes to character

Thanks

Joe

User avatar
unixkd
Posts: 623
Joined: Thu Feb 11, 2010 1:39 pm

Re: How to change currency symbol in windows

#5 Post by unixkd »

Hi all

I got the dc_regquerry() and dc_regwrite() working. Now I have one problem some currency symbols have decimal code outside the range 0 to 255 and therefore cannot be copied to the program or saved into database. Like Korea won and Nigeria Naira for example has decimal code 8358. They also have hexadecimal codes. Is there a function similar to chr() that can convert the hexadecimal codes to character

Thanks

Joe

User avatar
SlavkoDam
Posts: 149
Joined: Wed Apr 27, 2022 10:12 am
Location: Negotin, Serbia
Contact:

Re: How to change currency symbol in windows

#6 Post by SlavkoDam »

Hi,

My PowerUtl library have functions to convert char to/from hex, char to/from bin, dec to/from hex, dec to/from bin, dec to/from byte string, but I suppose this is not an option for you. You can check Ot4xb library.
Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs

k-insis
Posts: 144
Joined: Fri Jan 28, 2011 4:07 am

Re: How to change currency symbol in windows

#7 Post by k-insis »

@Joe: User program should not change users local language/date/currency settings for entire OS .

Is there reason ? Like printing out invoices into PDF but with different currency each time and report using 'currency' field to print like old R&R .
unixkd wrote: Fri Jul 04, 2025 2:00 am How can I programmatically change the currency symbol at runtime using either dc_regquery/dc_regwrite() or winapi functions.

bwolfsohn
Posts: 654
Joined: Thu Jan 28, 2010 7:07 am
Location: Newberry, Florida USA
Contact:

Re: How to change currency symbol in windows

#8 Post by bwolfsohn »

It's been a bunch of years, but I remember writing a function i.e. mycurrency() which would return the correct code to print.
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
breadmanbrian@bsky.social
http://www.breadmanrises.com
FB travel group: The Breadman Rises

User avatar
unixkd
Posts: 623
Joined: Thu Feb 11, 2010 1:39 pm

Re: How to change currency symbol in windows

#9 Post by unixkd »

Hi Brian

Kindly post the source for mycurrency() function that you mentioned for members benefits

Thanks

Joe

bwolfsohn
Posts: 654
Joined: Thu Jan 28, 2010 7:07 am
Location: Newberry, Florida USA
Contact:

Re: How to change currency symbol in windows

#10 Post by bwolfsohn »

I haven't seen the code since I sold the company in 2019. But, it was a series of do case statements, where it would return the currency character based on the currency choice of the buyer or seller record.

Roger might have the old code somewhere. I don't have it anymore.

it would be called something like:

at xx,yy dc_say mycurrency(buyer or seller variable) + the amount to print.

Wish I could be more help, but I haven't touched coding in 6 years.
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
breadmanbrian@bsky.social
http://www.breadmanrises.com
FB travel group: The Breadman Rises

Post Reply