Programatically change Non-Unicode Language Id

G

Gunter W

I've searched through all the postings and have not found the
recommended way
to change ONLY the non-unicode language ID programatically.

I've tracked down the registry value that holds the non-unicode
language ID

\HKLM\SYSTEM\\CurrentControlSet\\Control\\Nls\\Language

and when I modify this and reboot it works most of the time.

The problem is sometimes after the reboot I get the error message
file is missing or corrupt
\WINDOWS\system32\config\SYSTEM

I've traced what registry changes occur when I modify the value
through the Control Panel, but there are mods made all over the place,
and capturing all of this and putting in my source code would probably
not work for very long with changes/updates to the OS.

There doesn't seem to be any API's (ie NLS) available that lets you
change this value directly.

I've also noticed a program called AppLocale,
http://www.microsoft.com/globaldev/tools/apploc.mspx
that sets the language for a particular application.
This would work for me if there was an API for this program instead of
just
the GUI frontend.

Does anyone have any ideas/sugesstions?
 
K

KM

Gunter,

I don't know the API but have you considered running intl.cpl in unattended mode? Something like this:
rundll32.exe shell32,Control_RunDLL intl.cpl,,/f:"c:\Unattend.txt"
(assuming you've got the International Control Applet in your image)

Check what you can add to the Unattend.txt ([RegionalSettings] section) here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;289125&sd=tech
Some good info also here:
http://www.microsoft.com/resources/...p?url=/resources/documentation/Windows/XP/all
/reskit/en-us/prff_mul_bafv.asp

This way you will be able to configure the language for non-Unicode programs to the language you prefer (need).

You may want to play with it first at runtime. If it works fine for you and on your XPe image, you can automate it with a FBA
Generic Command.
 
K

KM

And of course, you can use undocumented NTDLL APIs like :
NtQueryDefaultLocale/NtSetDefaultLocale.

More details here:
http://undocumented.ntinternals.net/UserMode/Undocumented Functions/Locale/NtSetDefaultLocale.html

KM
Gunter,

I don't know the API but have you considered running intl.cpl in
unattended mode? Something like this:
rundll32.exe shell32,Control_RunDLL intl.cpl,,/f:"c:\Unattend.txt"
(assuming you've got the International Control Applet in your image)

Check what you can add to the Unattend.txt ([RegionalSettings] section) here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;289125&sd=tech
Some good info also here:
http://www.microsoft.com/resources/...p?url=/resources/documentation/Windows/XP/all
/reskit/en-us/prff_mul_bafv.asp

This way you will be able to configure the language for non-Unicode
programs to the language you prefer (need).
You may want to play with it first at runtime. If it works fine for you
and on your XPe image, you can automate it with a FBA
 
G

Gunter W

KM,
The NtSetDefaultLocale function works perfectly MUCHO THANKS!!!!
Gunter

KM said:
And of course, you can use undocumented NTDLL APIs like :
NtQueryDefaultLocale/NtSetDefaultLocale.

More details here:
http://undocumented.ntinternals.net/UserMode/Undocumented Functions/Locale/NtSetDefaultLocale.html

KM
Gunter,

I don't know the API but have you considered running intl.cpl in
unattended mode? Something like this:
rundll32.exe shell32,Control_RunDLL intl.cpl,,/f:"c:\Unattend.txt"
(assuming you've got the International Control Applet in your image)

Check what you can add to the Unattend.txt ([RegionalSettings] section) here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;289125&sd=tech
Some good info also here:
http://www.microsoft.com/resources/...p?url=/resources/documentation/Windows/XP/all
/reskit/en-us/prff_mul_bafv.asp

This way you will be able to configure the language for non-Unicode
programs to the language you prefer (need).
You may want to play with it first at runtime. If it works fine for you
and on your XPe image, you can automate it with a FBA
Generic Command.
 
Joined
Feb 24, 2009
Messages
1
Reaction score
0
solution?

Hello,
I have stumbled at the same problem.
Gunter - i saw you said you got this thing fixed up.
How do I use your solution?
Any tip will be much appriciated.

Thanks in advance!
Alon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top