In this installment, the Doctor covers a broad range of issues dealing with:
I am just getting into localization programming and am wondering, "What concerns should I have about writing/reading text to the registry?"
For example, is the key "[HKCU]\Software" spelled the same regardless of the Windows OS language?
I have read a few articles on localization issues and find no mention of registry key names/values and different Windows languages.
Thanks for any assistance you can provide,
Greg
Dear Greg,
Good question. Before I answer, the Doctor wants to state that as a general rule, putting localizable resources in the registry should be discouraged. It makes it harder to create localized applications. For a better understanding of creating multilingual applications, you may want to read Writing Multilingual User Interface Applications.
Now for your original question, all registry keys in Windows (created by the OS) are language neutral (for example the key HKCU\Software does not get localized), however, some of the registry values themselves might be localized.
I have a problem with my Belgian AZERTY keyboard layout under Windows 2000. When I log in on my domain, the keyboard works perfect, but at the login screen at startup the keyboard layout is QWERTY (I guess US international). I immediately thought of changing it with keyb.com, but that file can't be found on the PC. Can you help me with this problem?
Thanks in advance,
M.A.
Dear M.A.,
You are correct to say that once you login to a system you can set what keyboard to use, but at logon time, the default selected keyboard is the same as the default keyboard layout that was chosen during the setup of Windows 2000 (in your case English–US).
For Windows 2000 there isn't any system settings you can change to add more keyboards for the logon dialog, but there is a workaround for those who have administrator rights to the computer. Here it is:
| • | First add the keyboard layout you wanted to the your current user (open "Settings=>Control Panel=>Regional Options" and add a keyboard layout) |
| • | Open "regedit" in HKCU\Keyboard Layout\Preload |
| • | Look for the key you added |
| • | Create the same key value in HKU\.DEFAULT\Keyboard Layout\Preload |
| • | You will also need to replicate, the "Substitutes" folder. |
Once you have set this up, you can select a different input locale in the logon dialog by:
1. | Press the "Options >>" button. This will allow you to see the input locale in a blue rectangle. |
2. | Use <Right Alt>+<Shift> to toggle between the different installed input locales. |
Now the good news is that Windows XP will make all this much simpler. The way you are able to do this (for those of you how are on the beta program now and for those of you that will upgrade when it comes out, all of you I hope) is the following:
| • | Open the "Regional and Language Options" in the Control Panel and go to the "language" tag |
| • | Click the "detail" button and add all the keyboards you want to use in the logon window. |
| • | Go to the "advance" tag in the regional and language option. |
| • | Check the check box under "default user account settings" (The system then applies all the settings of the current user account to the default user profile.) |
Now when you go to the logon dialog do the same as mentioned above with the <Right Alt>+<Shift> key combination to toggle through the available keyboards.
Do you know how to access/download the Urdu keyboard for Windows 2000?
aak
Dear aak,
The Urdu keyboard was not released as part of the Windows 2000 original installation CD's, but you can now get it from the Microsoft.com web site at http://www.microsoft.com/middleeast/arabicdev/Urdu/urdu.asp. This web site also has links to helps about how to handle Arabic languages in VC++, Visual Basic 6 and web pages.
EnumSystemCodePages takes a flag for enumerating installed or supported codepages. (CP_INSTALLED CP_SUPPORTED )
What's the difference between an installed and a supported codepage?
Does WideCharToMultiByte work for all installed, or supported codepages?
J.W.
Dear J.W.,
That's an excellent question. Here is what it all means:
Installed code pages references the c_xxxx.nls files that exists in the system32 folder. Only installed code pages will work with the WideCharToMultiByte API. Many code pages are installed by default in the case of the upcoming Windows XP, some are installed only on localized builds, and some others are installed if you install a language collection (for example a Mac code page for Japanese), but there are some that you must explicitly install (e.g. c_858.nls that is the only OEM code page with Euro symbol).
Supported code pages on the other hand is the list of all those code pages that can possibly be installed.
I have a font problem. I use the Common Dialog Control to let users choose a font. It works quite good except the so–called "script" of font. (I hope it is the right term, I use Hungarian Windows and it says "írásrendszer". On a sample figure of MSDN–help it is written as "script".) What I mean is the property of Western/Eastern –European, Arabic, Cyrillic, etc.
So my question is:How to determine which script was chosen by the user?(And can I provide a default script before displaying the control?)
Thanks...
GeoP
Dear GeoP,
For both purposes you should use the lfCharSet attribute of the LOGFONT structure. This structure can be pre–populated to define the rules for font enumeration in a ChooseFont call. After the call, lfCharSet contains the font information set by the user in the font–selection dialog.
Well I hope that these short and to the point answers to your questions are of some help. See you next time!
Dr. International
Windows Division