Page 1 of 2
How to change currency symbol in windows
Posted: Fri Jul 04, 2025 2:00 am
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
Re: How to change currency symbol in windows
Posted: Fri Jul 04, 2025 5:43 am
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.
Re: How to change currency symbol in windows
Posted: Fri Jul 04, 2025 7:58 am
by unixkd
Hi Tom
Great !!!
I appreciate
Joe
Re: How to change currency symbol in windows
Posted: Sat Jul 05, 2025 4:47 pm
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
Re: How to change currency symbol in windows
Posted: Sat Jul 05, 2025 4:50 pm
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
Re: How to change currency symbol in windows
Posted: Thu Jul 10, 2025 1:45 am
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.
Re: How to change currency symbol in windows
Posted: Sun Jul 13, 2025 11:15 pm
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.
Re: How to change currency symbol in windows
Posted: Mon Jul 14, 2025 10:14 am
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.
Re: How to change currency symbol in windows
Posted: Tue Jul 15, 2025 9:12 am
by unixkd
Hi Brian
Kindly post the source for mycurrency() function that you mentioned for members benefits
Thanks
Joe
Re: How to change currency symbol in windows
Posted: Tue Jul 15, 2025 3:16 pm
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.