|
-
October 22nd, 2004, 07:07 PM
#1
(Urgent:) Change system locale programatically
Hi,
I have a requirement to change the system locale using Win32 API. There is a call GetSystemDefaultLCID but nothing like SetSystemDefaultLCID to set the default locale. Such a method is available in coredll.dll but looks like it's not free. Is that right?
Any information on this or any workaround with a sample code would be greatly appreciated!
Thanks,
Kannan
-
October 22nd, 2004, 07:08 PM
#2
Change system locale programatically
Hi,
I have a requirement to change the system locale using Win32 API or MFC. There is a call GetSystemDefaultLCID but nothing like SetSystemDefaultLCID to set the default locale. Such a method is available in coredll.dll but looks like it's not free. Is that right?
Any information on this or any workaround with a sample code would be greatly appreciated!
Thanks,
Kannan
-
October 22nd, 2004, 07:09 PM
#3
(Urgent:)Change system locale programatically
Hi,
I have a requirement to change the system locale using Win32 API. There is a call GetSystemDefaultLCID but nothing like SetSystemDefaultLCID to set the default locale. Such a method is available in coredll.dll but looks like it's not free. Is that right?
Any information on this or any workaround with a sample code would be greatly appreciated!
Thanks,
Kannan
-
October 22nd, 2004, 07:44 PM
#4
Re: (Urgent:) Change system locale programatically
Take a look at SetLocaleInfo()
Henri Hein
Principal Engineer, Propel
Do not credit Propel with my views or opinions.
-
October 22nd, 2004, 08:04 PM
#5
Re: (Urgent:) Change system locale programatically
Hi,
Thanks for the response.
SetLocaleInfo impacts only at the user's session not at system level.
Thanks,
Kannan
-
October 22nd, 2004, 10:34 PM
#6
Re: Change system locale programatically
 Originally Posted by kannanbalu
I have a requirement to change the system locale using Win32 API or MFC. There is a call GetSystemDefaultLCID but nothing like SetSystemDefaultLCID to set the default locale.
The system locale is a setting made by the user (or the administrator) of an installation - applications should take it into consideration, but not change it. What's the reason for the requirement to change the locale? I'd question that in the first place. In any case, you can change individual parts of the locale info for your own process via SetLocaleInfo(), if that's what you need.
-
October 22nd, 2004, 11:32 PM
#7
Re: Change system locale programatically
Hi,
Thanks for the response. I've a requirement where I need to run some of my testcases on different locales automatically. I was under the impression that anything was possible with Win32 API/MFC. SetLocaleInfo is only at the user session. I'm looking for changing the system default itself.
One dirty workaround could be to send messages to the Regional Options (in Control Panel) and do all the operations that we normally do manually to change the system default. But I'm sure there must be a better way of handling it.
I know coredll.dll has a method for doing this but I guess it's not free 
Thanks,
Kannan
-
October 23rd, 2004, 05:34 AM
#8
Re: Change system locale programatically
 Originally Posted by kannanbalu
I know coredll.dll has a method for doing this but I guess it's not free 
What do you mean by "it's not free" - that you have to pay for calling it? Seriously, if the DLL has that function, and you know it, than it might be at worst undocumented, but you can call it. You just need to figure out the correct calling parameters and return value, but in the case of SetSystemDefaultLCID that should be easy. And if it's just for a test case used during development, there's nothing too bad about using undocumented API functions. I just don't understand what you are referring to when you say "coredll.dll" - AFAIK, it's non of the Win32 system DLLs.
-
October 23rd, 2004, 08:12 AM
#9
Re: (Urgent:)Change system locale programatically
You basically can't change it, unless you reinstall Windows. There is a program from Microsoft which lets you run individual programs with a "different system locale", but all that this does is that it intercepts API calls and returns the locale you specified.
Why do you want/need to do this anyways?
[P.S. Moved to the Win32 forum, which is more appropriate]
Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
Supports C++ and VB out of the box, but can be configured for other languages.
-
October 23rd, 2004, 08:17 AM
#10
Re: Change system locale programatically
[ Oh and don't cross-post, that just leaves people with no idea what others have answered. Just choose the most appropriate forum from the start ]
[ Merged threads ]
Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
Supports C++ and VB out of the box, but can be configured for other languages.
-
October 23rd, 2004, 08:19 AM
#11
Re: Change system locale programatically
Just found the link back from that MS tool. It's called AppLocale and you can find it on their Globaldev site.
Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
Supports C++ and VB out of the box, but can be configured for other languages.
-
October 23rd, 2004, 08:24 AM
#12
Re: Change system locale programatically
 Originally Posted by gstercken
I just don't understand what you are referring to when you say "coredll.dll" - AFAIK, it's non of the Win32 system DLLs.
Windows CE....I thunk...
-
October 23rd, 2004, 11:30 AM
#13
Re: Change system locale programatically
Hi all,
Thanks for all the responses.
> I just don't understand what you are referring to when you say "coredll.dll" - AFAIK, it's non of the Win32 system DLLs.
You're right. coredll.dll is not a win32 system dll. I found it on the web and as I said you need to pay for it.
The AppLocale seems to be interesting. I'll try it out.
Thanks,
Kannan
-
May 7th, 2009, 11:58 PM
#14
Re: Change system locale programatically
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|