Click here to Skip to main content
13,091,145 members (92,703 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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

1 solution

Rate this: bad
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.
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 (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 |
Web03 | 2.8.170813.1 | Last Updated 21 Nov 2012
Copyright © CodeProject, 1999-2017
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