简体   繁体   中英

Language for non-unicode programs and registry settings

Windows XP has a "Current language for non-Unicode programs" option in the Control Panel / Region and Language Settings.

One can use this to get non-unicode programs to respond to the selected language.

However there are some programs that don't respond to this setting and instead need registry changes to work. The registry change redirects the current language to another language.

Why do some programs respond to the First method (Control Panel) and others respond to the second (Registry). What is the underlying difference in code? Which calls/compile options can I expect to find in either kind of application?

If I had to convert one type of application (the one that responds to registry settings) to a program that used the Control Panel settings - what code changes are needed?

Thanks.

The registry keys you mentioned does nothing but map some code pages to CP1251 (Cyrillic) effectively forcing CP1251 to be used throughout a system. So actually the program you mention has some of information hardcoded.

Unfortunately, you haven't gave us much information on what is your real challenge, so I am assuming you need to either display 1) Localized UI correctly or 2) you want to allow entering Cyrillic characters.

Let's talk about the problems briefly:

  1. If you just cannot display localized texts correctly and the application was written using MFC, it is possible that the font for Dialogs is not set correctly (to MS Shell Dlg or MS Shell Dlg 2 whatever works in this case).

  2. In latter case and possibly in the first one as well, the application assumes that English-US is the language thou shall use and the language of the system shalt be En-US, effectively setting Locale to 1033 and default code page to CP1252. It might be hardcoded somewhere. In such case you would need to modify the source code (provided you have access to it) so that these properties come from OS settings.

To detect the language one should use:

LCID currentLocale = GetUserDefaultLCID();

And to detect current (so called ANSI) code page:

UINT currentCodePage = GetACP();

You can ask the registry to notify you when a value changes, but your program has to be running.

The Control Panel contains programs which are launched to make changes (usually a registry update underneath). When these special programs run, they can trigger any kind of update procedure.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM