Click here to Skip to main content
12,510,403 members (52,347 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C++ Windows
Is there any API in windows sdk that can be used to set the user or system locale?

Thanks in advance...
Posted 20-Nov-12 23:10pm
tkbineshb1.1K

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160929.1 | Last Updated 21 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100