Author |
Topic |
|
ctacke
877 Posts |
Posted - 13 Jan 2003 : 17:01:05
|
Q: My ADS System defaults to English (United States) at startup. I can change it through the Control Panel's Regional Settings, but when the device loses power or is reset, it returns to English. How can I persist my changes?
The Regional Settings are stored in the registry under
HKEY_LOCAL_MACHINE\nls\
The locale is in the DefaultLCID key, which is a REG_DWORD value. US English is 0x409 (1033).
Some languages also use the DefaultOCP and DefaultACP keys as well. We recommend setting it through the control panel manually and then reading the registry to get the values you want.
Once you have the values, you can persist them by modifying ADSLOAD.REG as described in the Developer's Getting Started Guide.
For more info, see this Microsoft article.
|
|
sean
1 Posts |
Posted - 20 Jan 2003 : 18:38:06
|
I added the following text to my ADSLOAD.REG file to change the Regional Settings to Spanish (Mexican). But, its still in English (United States) when I reboot. Anything I'm missing here?
[HKEY_LOCAL_MACHINE\nls] "DefaultOCP"=dword:352 "DefaultACP"=dword:4e4 "DefaultLCID"=dword:80a |
|
|
ctacke
877 Posts |
Posted - 04 Mar 2003 : 14:29:19
|
It seems that the locale (LCID) is stored in the above registry keys but must be set through an API call. Below is sample code (using an undocumented API) that will set the default Locale to Spanish, Mexican. This does not require a restart after setting it and could be used as ADSLOAD.EXE (also described in the Developer's GEtting Started Guide) to automatically set the locale at every load.
#include "windows.h" #include "winnls.h"
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { LANGID langid = MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MEXICAN); LCID lcid = MAKELCID(langid, SORT_DEFAULT);
DEBUGMSG(TRUE, (_T("Setting Locale to Spanish, Mexican (0x%04x...)"), lcid));
if(!SetSystemDefaultLCID(lcid)) { DEBUGMSG(TRUE, (_T("failed (%i)\r\n"), GetLastError())); return -1; }
DEBUGMSG(TRUE, (_T("ok.\r\n")));
return 0; }
|
|
|
|
Topic |
|
|
|