-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
cc-faq-localization.yml
86 lines (75 loc) · 4.99 KB
/
cc-faq-localization.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
### YamlMime:FAQ
metadata:
title: Localization Support for Common Controls
description: This topic describes the support for national languages that is built into the common controls.
ms.assetid: c5720198-9071-4213-8dad-50b4c015c5f0
ms.topic: faq
ms.date: 05/31/2018
title: Localization Support for Common Controls
summary: |
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.
sections:
- name: Ignored
questions:
- question: |
Specifying a Language for the Common Controls
answer: |
If you want to specify a language for the common controls that is different than the system language, call [**InitMUILanguage**](/windows/desktop/api/Commctrl/nf-commctrl-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**](/windows/desktop/api/Commctrl/nf-commctrl-getmuilanguage). It returns the value that was set by a previous call to [**InitMUILanguage**](/windows/desktop/api/Commctrl/nf-commctrl-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.
- question: |
Specifying a Language for Controls in a Dialog Box
answer: |
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.
1. Initialize the native font control by calling [**InitCommonControlsEx**](/windows/desktop/api/Commctrl/nf-commctrl-initcommoncontrolsex). Set the **dwICC** member of the [**INITCOMMONCONTROLSEX**](/windows/win32/api/commctrl/ns-commctrl-initcommoncontrolsex) structure pointed to by *lpInitCtrls* to ICC\_NATIVEFNTCTL\_CLASS.
2. 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.
<style type="text/css">
.tg {border-collapse:collapse;border-spacing:0;}
.tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
overflow:hidden;padding:10px 5px;word-break:normal;}
.tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
.tg .tg-0pky{border-color:inherit;text-align:left;vertical-align:top}
</style>
<table class="tg">
<thead>
<tr>
<th class="tg-0pky">Flag</th>
<th class="tg-0pky">Applies to</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tg-0pky">NFS\_EDIT</td>
<td class="tg-0pky">Edit controls</td>
</tr>
<tr>
<td class="tg-0pky">NFS\_STATIC</td>
<td class="tg-0pky">Static controls</td>
</tr>
<tr>
<td class="tg-0pky">NFS\_LISTCOMBO</td>
<td class="tg-0pky">List, ComboBox, List-View, and ComboBoxEx controls</td>
</tr>
<tr>
<td class="tg-0pky">NFS\_BUTTON</td>
<td class="tg-0pky">Button controls</td>
</tr>
<tr>
<td class="tg-0pky">NFS\_ALL</td>
<td class="tg-0pky">All controls</td>
</tr>
<tr>
<td class="tg-0pky">NFS\_USEFONTASSOC</td>
<td class="tg-0pky">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.</td>
</tr>
</tbody>
</table>
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.
```
CONTROL "",-1,"NativeFontCtl",NFS_EDIT|NFS_LISTCOMBO,0,0,0,0
```
additionalContent: |
## Related topics
[About Common Controls](common-controls-intro.md)