Localization Support for Common Controls
This topic describes the support for national languages that is built into the common controls. The built-in national language support simplifies the implementation of localized applications.
This topic contains the following sections:
- Specifying a Language for the Common Controls
- Specifying a Language for Controls in a Dialog Box
- Related topics
If you want to specify a language for the common controls that is different than the system language, call InitMUILanguage. The language specified by this function applies only to the process from which the function is called.
To determine the language currently being used by the common controls, call GetMUILanguage. It returns the value that was set by a previous call to InitMUILanguage. The language returned is the one that was specified for the process it is called from. If InitMUILanguage has not been called, or was called from another process, GetMUILanguage will return a default value.
Unlike common controls, predefined controls such as buttons or edit boxes do not use the current system language by default. The native font control is an invisible control that works in the background to allow a dialog box's predefined controls to display the current system language.
To use the native font control, follow this procedure.
- Initialize the native font control by calling InitCommonControlsEx. Set the dwICC member of the INITCOMMONCONTROLSEX structure pointed to by lpInitCtrls to ICC_NATIVEFNTCTL_CLASS.
Add the control to the resource script for the dialog box. Set one or more of the following style flags to specify which controls will be affected.
Flag Applies to NFS_EDIT Edit controls NFS_STATIC Static controls NFS_LISTCOMBO List, ComboBox, List-View, and ComboBoxEx controls NFS_BUTTON Button controls NFS_ALL All controls NFS_USEFONTASSOC East Asian platform. The control uses the font association feature instead of switching to the native font. All other platforms ignore it. This is deprecated for Windows Vista, and is not supported in comctl v6. This exists in comctl v5 for legacy reasons.
The following example illustrates how to add a native font control to a resource script. It causes the dialog box's edit, list, and combo box controls to display text using the current system language.