Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change windows regional settings?

Status
Not open for further replies.

gcaramia

Programmer
Oct 30, 2003
185
IT
Is it possible to change the windows regional settings permanently from inside D7 program?

Thanks
Giovanni Caramia
 
Permanently... Maybe it's possible, but are you sure you want to do that.

isn't it enough to change it by session. Then you can use the built in global variables like "Thousandseparator" and more

KungTure-RX.jpg

//Nordlund
 
with 'permanently' i mean to change settings in windows, the same as we can do from control panel/regional settings.

what i'm looking for is how to change ThousandSeparators and DecimalSeparator.

I found how to change time format:

Code:
var
Locale : LongInt;
begin
Locale := GetUserDefaultLCID(); 
SetLocaleInfo(Locale, LOCALE_STIMEFORMAT, 'HH:mm:ss');
SendMessage(HWND_BROADCAST,WM_WININICHANGE,0,0);

now, for numbers?
 
Solved (from Delphi-Help):

Code:
var
Locale : LongInt;
begin
Locale := GetUserDefaultLCID();
SetLocaleInfo(Locale, LOCALE_SThousand, '''');
SetLocaleInfo(Locale, LOCALE_SDecimal, '.');
SendMessage(HWND_BROADCAST,WM_WININICHANGE,0,0);

This for everyone who needs

Giovanni Caramia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top