Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is there any API in windows sdk that can be used to set the user or system locale?

Thanks in advance...
Posted

1 solution

You may use the Windows Vista Command Line Configuration of International Settings[^] and execute it from your C++ code. With Windows versions prior to Vista there is a similar method using a plain text file: 'rundll32 shell32, Control_RunDLL intl.cpl,,/f:"c:locale.txt"'.

Changing the global locales is an administrative process that should not be done by normal applications. If you want to change the locale of an application, use the SetThreadLocale() and setlocale() functions.
 
Share this answer
 
Comments
tkbineshb 21-Nov-12 6:56am    
I excecuted the command for windows 7 and the user locale changed and
did same for Window XP using txt file ,but the locale remained same.
Does the data in txt have some other format or should I use the same data as that of windows 7?
Jochen Arndt 21-Nov-12 7:06am    
The file format for XP is different (plain text file rather a XML file). See http://support.microsoft.com/kb/289125 (it contains the file format).
tkbineshb 21-Nov-12 23:05pm    
Thanks Jochen

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900