xref: /reactos/sdk/include/psdk/imm.h (revision 8ea93d2a)
1 /*
2  * PROJECT:     ReactOS headers
3  * LICENSE:     LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4  * PURPOSE:     Declarations for IMM32
5  * COPYRIGHT:   Copyright (C) the Wine project
6  *              Copyright (C) 2021-2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
7  */
8 
9 #ifndef __WINE_IMM_H
10 #define __WINE_IMM_H
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 #if (WINVER >= 0x040A)
17 DECLARE_HANDLE(HIMC);
18 DECLARE_HANDLE(HIMCC);
19 #else
20 typedef DWORD HIMC;
21 typedef DWORD HIMCC;
22 #endif
23 
24 typedef HKL FAR *LPHKL;
25 typedef UINT FAR *LPUINT;
26 
27 typedef struct tagREGISTERWORDA {
28     LPSTR lpReading;
29     LPSTR lpWord;
30 } REGISTERWORDA, *PREGISTERWORDA, NEAR *NPREGISTERWORDA, FAR *LPREGISTERWORDA;
31 
32 typedef struct tagREGISTERWORDW {
33     LPWSTR lpReading;
34     LPWSTR lpWord;
35 } REGISTERWORDW, *PREGISTERWORDW, NEAR *NPREGISTERWORDW, FAR *LPREGISTERWORDW;
36 
37 typedef INT (CALLBACK *REGISTERWORDENUMPROCA)(
38     _In_ LPCSTR lpszReading,
39     _In_ DWORD dwStyle,
40     _In_ LPCSTR lpszRegister,
41     _Inout_opt_ LPVOID lpData);
42 
43 typedef INT (CALLBACK *REGISTERWORDENUMPROCW)(
44     _In_ LPCWSTR lpszReading,
45     _In_ DWORD dwStyle,
46     _In_ LPCWSTR lpszRegister,
47     _Inout_opt_ LPVOID lpData);
48 
49 typedef struct tagCANDIDATEFORM {
50     DWORD dwIndex;
51     DWORD dwStyle;
52     POINT ptCurrentPos;
53     RECT  rcArea;
54 } CANDIDATEFORM, *PCANDIDATEFORM, NEAR *NPCANDIDATEFORM, FAR *LPCANDIDATEFORM;
55 
56 typedef struct tagCANDIDATELIST {
57     DWORD dwSize;
58     DWORD dwStyle;
59     DWORD dwCount;
60     DWORD dwSelection;
61     DWORD dwPageStart;
62     DWORD dwPageSize;
63     DWORD dwOffset[ANYSIZE_ARRAY];
64 } CANDIDATELIST, *PCANDIDATELIST, NEAR *NPCANDIDATELIST, FAR *LPCANDIDATELIST;
65 
66 #define STYLE_DESCRIPTION_SIZE 32
67 
68 typedef struct tagSTYLEBUFA {
69     DWORD dwStyle;
70     CHAR  szDescription[STYLE_DESCRIPTION_SIZE];
71 } STYLEBUFA, *PSTYLEBUFA, NEAR *NPSTYLEBUFA, FAR *LPSTYLEBUFA;
72 
73 typedef struct tagSTYLEBUFW {
74     DWORD dwStyle;
75     WCHAR  szDescription[STYLE_DESCRIPTION_SIZE];
76 } STYLEBUFW, *PSTYLEBUFW, NEAR *NPSTYLEBUFW, FAR *LPSTYLEBUFW;
77 
78 #if (WINVER >= 0x040A)
79 
80 typedef struct tagRECONVERTSTRING {
81     DWORD dwSize;
82     DWORD dwVersion;
83     DWORD dwStrLen;
84     DWORD dwStrOffset;
85     DWORD dwCompStrLen;
86     DWORD dwCompStrOffset;
87     DWORD dwTargetStrLen;
88     DWORD dwTargetStrOffset;
89 } RECONVERTSTRING, *PRECONVERTSTRING, NEAR *NPRECONVERTSTRING, FAR *LPRECONVERTSTRING;
90 
91 #define IMEMENUITEM_STRING_SIZE 80
92 
93 typedef struct tagIMEMENUITEMINFOA {
94     UINT        cbSize;
95     UINT        fType;
96     UINT        fState;
97     UINT        wID;
98     HBITMAP     hbmpChecked;
99     HBITMAP     hbmpUnchecked;
100     DWORD       dwItemData;
101     CHAR        szString[IMEMENUITEM_STRING_SIZE];
102     HBITMAP     hbmpItem;
103 } IMEMENUITEMINFOA, *PIMEMENUITEMINFOA, NEAR *NPIMEMENUITEMINFOA, FAR *LPIMEMENUITEMINFOA;
104 
105 typedef struct tagIMEMENUITEMINFOW {
106     UINT        cbSize;
107     UINT        fType;
108     UINT        fState;
109     UINT        wID;
110     HBITMAP     hbmpChecked;
111     HBITMAP     hbmpUnchecked;
112     DWORD       dwItemData;
113     WCHAR       szString[IMEMENUITEM_STRING_SIZE];
114     HBITMAP     hbmpItem;
115 } IMEMENUITEMINFOW, *PIMEMENUITEMINFOW, NEAR *NPIMEMENUITEMINFOW, FAR *LPIMEMENUITEMINFOW;
116 
117 #ifdef UNICODE
118     typedef IMEMENUITEMINFOW IMEMENUITEMINFO;
119     typedef PIMEMENUITEMINFOW PIMEMENUITEMINFO;
120     typedef NPIMEMENUITEMINFOW NPIMEMENUITEMINFO;
121     typedef LPIMEMENUITEMINFOW LPIMEMENUITEMINFO;
122 #else
123     typedef IMEMENUITEMINFOA IMEMENUITEMINFO;
124     typedef PIMEMENUITEMINFOA PIMEMENUITEMINFO;
125     typedef NPIMEMENUITEMINFOA NPIMEMENUITEMINFO;
126     typedef LPIMEMENUITEMINFOA LPIMEMENUITEMINFO;
127 #endif
128 
129 typedef struct tagIMECHARPOSITION {
130     DWORD       dwSize;
131     DWORD       dwCharPos;
132     POINT       pt;
133     UINT        cLineHeight;
134     RECT        rcDocument;
135 } IMECHARPOSITION, *PIMECHARPOSITION, *NPIMECHARPOSITION, *LPIMECHARPOSITION;
136 
137 typedef BOOL (CALLBACK *IMCENUMPROC)(_In_ HIMC hIMC, _In_ LPARAM lParam);
138 
139 #endif /* WINVER >= 0x040A */
140 
141 typedef struct _tagCOMPOSITIONFORM {
142     DWORD   dwStyle;
143     POINT ptCurrentPos;
144     RECT  rcArea;
145 } COMPOSITIONFORM, *PCOMPOSITIONFORM, NEAR *NPCOMPOSITIONFORM, FAR *LPCOMPOSITIONFORM;
146 
147 /* wParam for WM_IME_CONTROL */
148 #define IMC_GETCANDIDATEPOS             0x0007
149 #define IMC_SETCANDIDATEPOS             0x0008
150 #define IMC_GETCOMPOSITIONFONT          0x0009
151 #define IMC_SETCOMPOSITIONFONT          0x000A
152 #define IMC_GETCOMPOSITIONWINDOW        0x000B
153 #define IMC_SETCOMPOSITIONWINDOW        0x000C
154 #define IMC_GETSTATUSWINDOWPOS          0x000F
155 #define IMC_SETSTATUSWINDOWPOS          0x0010
156 #define IMC_CLOSESTATUSWINDOW           0x0021
157 #define IMC_OPENSTATUSWINDOW            0x0022
158 
159 /* dwAction for ImmNotifyIME  */
160 #define NI_OPENCANDIDATE                0x0010
161 #define NI_CLOSECANDIDATE               0x0011
162 #define NI_SELECTCANDIDATESTR           0x0012
163 #define NI_CHANGECANDIDATELIST          0x0013
164 #define NI_FINALIZECONVERSIONRESULT     0x0014
165 #define NI_COMPOSITIONSTR               0x0015
166 #define NI_SETCANDIDATE_PAGESTART       0x0016
167 #define NI_SETCANDIDATE_PAGESIZE        0x0017
168 #define NI_IMEMENUSELECTED              0x0018
169 
170 /* lParam for WM_IME_SETCONTEXT */
171 #define ISC_SHOWUICANDIDATEWINDOW       0x00000001
172 #define ISC_SHOWUICOMPOSITIONWINDOW     0x80000000
173 #define ISC_SHOWUIGUIDELINE             0x40000000
174 #define ISC_SHOWUIALLCANDIDATEWINDOW    0x0000000F
175 #define ISC_SHOWUIALL                   0xC000000F
176 
177 /* dwIndex for ImmNotifyIME/NI_COMPOSITIONSTR */
178 #define CPS_COMPLETE                    0x0001
179 #define CPS_CONVERT                     0x0002
180 #define CPS_REVERT                      0x0003
181 #define CPS_CANCEL                      0x0004
182 
183 /* the modifiers of hot key */
184 #define MOD_ALT                         0x0001
185 #define MOD_CONTROL                     0x0002
186 #define MOD_SHIFT                       0x0004
187 
188 #define MOD_LEFT                        0x8000
189 #define MOD_RIGHT                       0x4000
190 
191 #define MOD_ON_KEYUP                    0x0800
192 #define MOD_IGNORE_ALL_MODIFIER         0x0400
193 
194 /* Windows for Simplified Chinese Edition hot key ID from 0x10 - 0x2F */
195 #define IME_CHOTKEY_IME_NONIME_TOGGLE           0x10
196 #define IME_CHOTKEY_SHAPE_TOGGLE                0x11
197 #define IME_CHOTKEY_SYMBOL_TOGGLE               0x12
198 
199 /* Windows for Japanese Edition hot key ID from 0x30 - 0x4F */
200 #define IME_JHOTKEY_CLOSE_OPEN                  0x30
201 
202 /* Windows for Korean Edition hot key ID from 0x50 - 0x6F */
203 #define IME_KHOTKEY_SHAPE_TOGGLE                0x50
204 #define IME_KHOTKEY_HANJACONVERT                0x51
205 #define IME_KHOTKEY_ENGLISH                     0x52
206 /* Windows for Tranditional Chinese Edition hot key ID from 0x70 - 0x8F */
207 #define IME_THOTKEY_IME_NONIME_TOGGLE           0x70
208 #define IME_THOTKEY_SHAPE_TOGGLE                0x71
209 #define IME_THOTKEY_SYMBOL_TOGGLE               0x72
210 
211 /* direct switch hot key ID from 0x100 - 0x11F */
212 #define IME_HOTKEY_DSWITCH_FIRST                0x100
213 #define IME_HOTKEY_DSWITCH_LAST                 0x11F
214 
215 /* IME private hot key from 0x200 - 0x21F */
216 #define IME_HOTKEY_PRIVATE_FIRST                0x200
217 #define IME_ITHOTKEY_RESEND_RESULTSTR           0x200
218 #define IME_ITHOTKEY_PREVIOUS_COMPOSITION       0x201
219 #define IME_ITHOTKEY_UISTYLE_TOGGLE             0x202
220 #define IME_ITHOTKEY_RECONVERTSTRING            0x203
221 #define IME_HOTKEY_PRIVATE_LAST                 0x21F
222 
223 /* parameter of ImmGetCompositionString */
224 #define GCS_COMPREADSTR                 0x0001
225 #define GCS_COMPREADATTR                0x0002
226 #define GCS_COMPREADCLAUSE              0x0004
227 #define GCS_COMPSTR                     0x0008
228 #define GCS_COMPATTR                    0x0010
229 #define GCS_COMPCLAUSE                  0x0020
230 #define GCS_CURSORPOS                   0x0080
231 #define GCS_DELTASTART                  0x0100
232 #define GCS_RESULTREADSTR               0x0200
233 #define GCS_RESULTREADCLAUSE            0x0400
234 #define GCS_RESULTSTR                   0x0800
235 #define GCS_RESULTCLAUSE                0x1000
236 
237 /* style bit flags for WM_IME_COMPOSITION */
238 #define CS_INSERTCHAR                   0x2000
239 #define CS_NOMOVECARET                  0x4000
240 
241 /* IME version constants */
242 #define IMEVER_0310                     0x0003000A
243 #define IMEVER_0400                     0x00040000
244 
245 /* IME property bits */
246 #define IME_PROP_AT_CARET               0x00010000
247 #define IME_PROP_SPECIAL_UI             0x00020000
248 #define IME_PROP_CANDLIST_START_FROM_1  0x00040000
249 #define IME_PROP_UNICODE                0x00080000
250 #define IME_PROP_COMPLETE_ON_UNSELECT   0x00100000
251 
252 /* IME UICapability bits */
253 #define UI_CAP_2700                     0x00000001
254 #define UI_CAP_ROT90                    0x00000002
255 #define UI_CAP_ROTANY                   0x00000004
256 #define UI_CAP_SOFTKBD                  0x00010000
257 
258 /* ImmSetCompositionString Capability bits */
259 #define SCS_CAP_COMPSTR                 0x00000001
260 #define SCS_CAP_MAKEREAD                0x00000002
261 #define SCS_CAP_SETRECONVERTSTRING      0x00000004
262 
263 /* IME WM_IME_SELECT inheritance Capability bits */
264 #define SELECT_CAP_CONVERSION           0x00000001
265 #define SELECT_CAP_SENTENCE             0x00000002
266 
267 /* ID for dwIndex of ImmGetGuideLine */
268 #define GGL_LEVEL                       0x00000001
269 #define GGL_INDEX                       0x00000002
270 #define GGL_STRING                      0x00000003
271 #define GGL_PRIVATE                     0x00000004
272 
273 /* ID for dwLevel of GUIDELINE Structure */
274 #define GL_LEVEL_NOGUIDELINE            0x00000000
275 #define GL_LEVEL_FATAL                  0x00000001
276 #define GL_LEVEL_ERROR                  0x00000002
277 #define GL_LEVEL_WARNING                0x00000003
278 #define GL_LEVEL_INFORMATION            0x00000004
279 
280 /* ID for dwIndex of GUIDELINE Structure */
281 #define GL_ID_UNKNOWN                   0x00000000
282 #define GL_ID_NOMODULE                  0x00000001
283 #define GL_ID_NODICTIONARY              0x00000010
284 #define GL_ID_CANNOTSAVE                0x00000011
285 #define GL_ID_NOCONVERT                 0x00000020
286 #define GL_ID_TYPINGERROR               0x00000021
287 #define GL_ID_TOOMANYSTROKE             0x00000022
288 #define GL_ID_READINGCONFLICT           0x00000023
289 #define GL_ID_INPUTREADING              0x00000024
290 #define GL_ID_INPUTRADICAL              0x00000025
291 #define GL_ID_INPUTCODE                 0x00000026
292 #define GL_ID_INPUTSYMBOL               0x00000027
293 #define GL_ID_CHOOSECANDIDATE           0x00000028
294 #define GL_ID_REVERSECONVERSION         0x00000029
295 #define GL_ID_PRIVATE_FIRST             0x00008000
296 #define GL_ID_PRIVATE_LAST              0x0000FFFF
297 
298 /* ID for dwIndex of ImmGetProperty */
299 #define IGP_GETIMEVERSION               (DWORD)(-4)
300 #define IGP_PROPERTY                    0x00000004
301 #define IGP_CONVERSION                  0x00000008
302 #define IGP_SENTENCE                    0x0000000C
303 #define IGP_UI                          0x00000010
304 #define IGP_SETCOMPSTR                  0x00000014
305 #define IGP_SELECT                      0x00000018
306 
307 /* dwIndex for ImmSetCompositionString API */
308 #define SCS_SETSTR                      (GCS_COMPREADSTR | GCS_COMPSTR)
309 #define SCS_CHANGEATTR                  (GCS_COMPREADATTR | GCS_COMPATTR)
310 #define SCS_CHANGECLAUSE                (GCS_COMPREADCLAUSE | GCS_COMPCLAUSE)
311 #define SCS_SETRECONVERTSTRING          0x00010000
312 #define SCS_QUERYRECONVERTSTRING        0x00020000
313 
314 /* attribute for COMPOSITIONSTRING Structure */
315 #define ATTR_INPUT                      0x00
316 #define ATTR_TARGET_CONVERTED           0x01
317 #define ATTR_CONVERTED                  0x02
318 #define ATTR_TARGET_NOTCONVERTED        0x03
319 #define ATTR_INPUT_ERROR                0x04
320 #define ATTR_FIXEDCONVERTED             0x05
321 
322 /* bit field for IMC_SETCOMPOSITIONWINDOW, IMC_SETCANDIDATEWINDOW */
323 #define CFS_DEFAULT                     0x0000
324 #define CFS_RECT                        0x0001
325 #define CFS_POINT                       0x0002
326 #define CFS_FORCE_POSITION              0x0020
327 #define CFS_CANDIDATEPOS                0x0040
328 #define CFS_EXCLUDE                     0x0080
329 
330 /* conversion direction for ImmGetConversionList */
331 #define GCL_CONVERSION                  0x0001
332 #define GCL_REVERSECONVERSION           0x0002
333 #define GCL_REVERSE_LENGTH              0x0003
334 
335 /* bit field for conversion mode */
336 #define IME_CMODE_ALPHANUMERIC          0x0000
337 #define IME_CMODE_NATIVE                0x0001
338 #define IME_CMODE_CHINESE               IME_CMODE_NATIVE
339 /* IME_CMODE_HANGEUL is old name of IME_CMODE_HANGUL. It will be gone eventually. */
340 #define IME_CMODE_HANGEUL               IME_CMODE_NATIVE
341 #define IME_CMODE_HANGUL                IME_CMODE_NATIVE
342 #define IME_CMODE_JAPANESE              IME_CMODE_NATIVE
343 #define IME_CMODE_KATAKANA              0x0002  /* only effect under IME_CMODE_NATIVE */
344 #define IME_CMODE_LANGUAGE              0x0003
345 #define IME_CMODE_FULLSHAPE             0x0008
346 #define IME_CMODE_ROMAN                 0x0010
347 #define IME_CMODE_CHARCODE              0x0020
348 #define IME_CMODE_HANJACONVERT          0x0040
349 #define IME_CMODE_SOFTKBD               0x0080
350 #define IME_CMODE_NOCONVERSION          0x0100
351 #define IME_CMODE_EUDC                  0x0200
352 #define IME_CMODE_SYMBOL                0x0400
353 #define IME_CMODE_FIXED                 0x0800
354 
355 /* bit field for sentence mode */
356 #define IME_SMODE_NONE                  0x0000
357 #define IME_SMODE_PLAURALCLAUSE         0x0001
358 #define IME_SMODE_SINGLECONVERT         0x0002
359 #define IME_SMODE_AUTOMATIC             0x0004
360 #define IME_SMODE_PHRASEPREDICT         0x0008
361 #define IME_SMODE_CONVERSATION          0x0010
362 
363 /* style of candidate */
364 #define IME_CAND_UNKNOWN                0x0000
365 #define IME_CAND_READ                   0x0001
366 #define IME_CAND_CODE                   0x0002
367 #define IME_CAND_MEANING                0x0003
368 #define IME_CAND_RADICAL                0x0004
369 #define IME_CAND_STROKE                 0x0005
370 
371 /* wParam of report message WM_IME_NOTIFY */
372 #define IMN_CLOSESTATUSWINDOW           0x0001
373 #define IMN_OPENSTATUSWINDOW            0x0002
374 #define IMN_CHANGECANDIDATE             0x0003
375 #define IMN_CLOSECANDIDATE              0x0004
376 #define IMN_OPENCANDIDATE               0x0005
377 #define IMN_SETCONVERSIONMODE           0x0006
378 #define IMN_SETSENTENCEMODE             0x0007
379 #define IMN_SETOPENSTATUS               0x0008
380 #define IMN_SETCANDIDATEPOS             0x0009
381 #define IMN_SETCOMPOSITIONFONT          0x000A
382 #define IMN_SETCOMPOSITIONWINDOW        0x000B
383 #define IMN_SETSTATUSWINDOWPOS          0x000C
384 #define IMN_GUIDELINE                   0x000D
385 #define IMN_PRIVATE                     0x000E
386 
387 #if (WINVER >= 0x040A)
388 
389 /* wParam of report message WM_IME_REQUEST */
390 #define IMR_COMPOSITIONWINDOW           0x0001
391 #define IMR_CANDIDATEWINDOW             0x0002
392 #define IMR_COMPOSITIONFONT             0x0003
393 #define IMR_RECONVERTSTRING             0x0004
394 #define IMR_CONFIRMRECONVERTSTRING      0x0005
395 #define IMR_QUERYCHARPOSITION           0x0006
396 #define IMR_DOCUMENTFEED                0x0007
397 
398 #endif
399 
400 /* error code of ImmGetCompositionString */
401 #define IMM_ERROR_NODATA                (-1)
402 #define IMM_ERROR_GENERAL               (-2)
403 
404 /* dialog mode of ImmConfigureIME */
405 #define IME_CONFIG_GENERAL              1
406 #define IME_CONFIG_REGISTERWORD         2
407 #define IME_CONFIG_SELECTDICTIONARY     3
408 
409 /* dialog mode of ImmEscape */
410 #define IME_ESC_QUERY_SUPPORT           0x0003
411 #define IME_ESC_RESERVED_FIRST          0x0004
412 #define IME_ESC_RESERVED_LAST           0x07FF
413 #define IME_ESC_PRIVATE_FIRST           0x0800
414 #define IME_ESC_PRIVATE_LAST            0x0FFF
415 #define IME_ESC_SEQUENCE_TO_INTERNAL    0x1001
416 #define IME_ESC_GET_EUDC_DICTIONARY     0x1003
417 #define IME_ESC_SET_EUDC_DICTIONARY     0x1004
418 #define IME_ESC_MAX_KEY                 0x1005
419 #define IME_ESC_IME_NAME                0x1006
420 #define IME_ESC_SYNC_HOTKEY             0x1007
421 #define IME_ESC_HANJA_MODE              0x1008
422 #define IME_ESC_AUTOMATA                0x1009
423 #define IME_ESC_PRIVATE_HOTKEY          0x100A
424 #define IME_ESC_GETHELPFILENAME         0x100B
425 
426 /* style of word registration */
427 #define IME_REGWORD_STYLE_EUDC          0x00000001
428 #define IME_REGWORD_STYLE_USER_FIRST    0x80000000
429 #define IME_REGWORD_STYLE_USER_LAST     0xFFFFFFFF
430 
431 #if (WINVER >= 0x040A)
432 
433 /* dwFlags for ImmAssociateContextEx */
434 #define IACE_CHILDREN           0x0001
435 #define IACE_DEFAULT            0x0010
436 #define IACE_IGNORENOCONTEXT    0x0020
437 
438 /* dwFlags for ImmGetImeMenuItems */
439 #define IGIMIF_RIGHTMENU        0x0001
440 
441 /* dwType for ImmGetImeMenuItems */
442 #define IGIMII_CMODE            0x0001
443 #define IGIMII_SMODE            0x0002
444 #define IGIMII_CONFIGURE        0x0004
445 #define IGIMII_TOOLS            0x0008
446 #define IGIMII_HELP             0x0010
447 #define IGIMII_OTHER            0x0020
448 #define IGIMII_INPUTTOOLS       0x0040
449 
450 /* fType of IMEMENUITEMINFO structure */
451 #define IMFT_RADIOCHECK         0x00001
452 #define IMFT_SEPARATOR          0x00002
453 #define IMFT_SUBMENU            0x00004
454 
455 /* fState of IMEMENUITEMINFO structure */
456 #define IMFS_GRAYED             MFS_GRAYED
457 #define IMFS_DISABLED           MFS_DISABLED
458 #define IMFS_CHECKED            MFS_CHECKED
459 #define IMFS_HILITE             MFS_HILITE
460 #define IMFS_ENABLED            MFS_ENABLED
461 #define IMFS_UNCHECKED          MFS_UNCHECKED
462 #define IMFS_UNHILITE           MFS_UNHILITE
463 #define IMFS_DEFAULT            MFS_DEFAULT
464 
465 #endif /* WINVER >= 0x040A */
466 
467 /* types of soft keyboard */
468 #define SOFTKEYBOARD_TYPE_T1    0x0001 /* for Tranditional Chinese */
469 #define SOFTKEYBOARD_TYPE_C1    0x0002 /* for Simplified Chinese */
470 
471 HIMC WINAPI ImmAssociateContext(_In_ HWND hWnd, _In_ HIMC hIMC);
472 #if (WINVER >= 0x040A)
473 BOOL WINAPI ImmAssociateContextEx(_In_ HWND hWnd, _In_ HIMC hIMC, _In_ DWORD dwFlags);
474 #endif
475 
476 BOOL WINAPI ImmConfigureIMEA(_In_ HKL hKL, _In_ HWND hWnd, _In_ DWORD dwMode, _In_ LPVOID lpData);
477 BOOL WINAPI ImmConfigureIMEW(_In_ HKL hKL, _In_ HWND hWnd, _In_ DWORD dwMode, _In_ LPVOID lpData);
478 HIMC WINAPI ImmCreateContext(VOID);
479 BOOL WINAPI ImmDestroyContext(_In_ HIMC hIMC);
480 #if (WINVER >= 0x040A)
481 BOOL WINAPI ImmDisableIME(_In_ DWORD idThread);
482 BOOL WINAPI ImmEnumInputContext(_In_ DWORD dwThreadId, _In_ IMCENUMPROC lpfn, _In_ LPARAM lParam);
483 #endif
484 
485 UINT
486 WINAPI
487 ImmEnumRegisterWordA(
488     _In_ HKL hKL,
489     _In_ REGISTERWORDENUMPROCA lpfnEnumProc,
490     _In_opt_ LPCSTR lpszReading,
491     _In_ DWORD dwStyle,
492     _In_opt_ LPCSTR lpszRegister,
493     _Inout_opt_ LPVOID lpData);
494 
495 UINT
496 WINAPI
497 ImmEnumRegisterWordW(
498     _In_ HKL hKL,
499     _In_ REGISTERWORDENUMPROCW lpfnEnumProc,
500     _In_opt_ LPCWSTR lpszReading,
501     _In_ DWORD dwStyle,
502     _In_opt_ LPCWSTR lpszRegister,
503     _Inout_opt_ LPVOID lpData);
504 
505 LRESULT WINAPI
506 ImmEscapeA(
507     _In_ HKL hKL,
508     _In_ HIMC hIMC,
509     _In_ UINT uSubFunc,
510     _Inout_opt_ LPVOID lpData);
511 
512 LRESULT WINAPI
513 ImmEscapeW(
514     _In_ HKL hKL,
515     _In_ HIMC hIMC,
516     _In_ UINT uSubFunc,
517     _Inout_opt_ LPVOID lpData);
518 
519 DWORD
520 WINAPI
521 ImmGetCandidateListA(
522     _In_ HIMC hIMC,
523     _In_ DWORD deIndex,
524     _Out_writes_bytes_opt_(dwBufLen) LPCANDIDATELIST lpCandList,
525     _In_ DWORD dwBufLen);
526 
527 DWORD
528 WINAPI
529 ImmGetCandidateListW(
530     _In_ HIMC hIMC,
531     _In_ DWORD deIndex,
532     _Out_writes_bytes_opt_(dwBufLen) LPCANDIDATELIST lpCandList,
533     _In_ DWORD dwBufLen);
534 
535 DWORD WINAPI ImmGetCandidateListCountA(_In_ HIMC hIMC, _Out_ LPDWORD lpdwListCount);
536 DWORD WINAPI ImmGetCandidateListCountW(_In_ HIMC hIMC, _Out_ LPDWORD lpdwListCount);
537 
538 BOOL
539 WINAPI
540 ImmGetCandidateWindow(
541     _In_ HIMC hIMC,
542     _In_ DWORD dwIndex,
543     _Out_ LPCANDIDATEFORM lpCandidate);
544 
545 #if defined(_WINGDI_) && !defined(NOGDI)
546 
547 BOOL WINAPI ImmGetCompositionFontA(_In_ HIMC hIMC, _Out_ LPLOGFONTA lplf);
548 BOOL WINAPI ImmGetCompositionFontW(_In_ HIMC hIMC, _Out_ LPLOGFONTW lplf);
549 
550 BOOL WINAPI ImmSetCompositionFontA(_In_ HIMC hIMC, _In_ LPLOGFONTA lplf);
551 BOOL WINAPI ImmSetCompositionFontW(_In_ HIMC hIMC, _In_ LPLOGFONTW lplf);
552 
553 #ifdef UNICODE
554     #define ImmGetCompositionFont ImmGetCompositionFontW
555 #else
556     #define ImmGetCompositionFont ImmGetCompositionFontA
557 #endif
558 
559 #endif
560 
561 LONG
562 WINAPI
563 ImmGetCompositionStringA(
564     _In_ HIMC hIMC,
565     _In_ DWORD dwIndex,
566     _Out_writes_bytes_opt_(dwBufLen) LPVOID lpBuf,
567     _In_ DWORD dwBufLen);
568 
569 LONG
570 WINAPI
571 ImmGetCompositionStringW(
572     _In_ HIMC hIMC,
573     _In_ DWORD dwIndex,
574     _Out_writes_bytes_opt_(dwBufLen) LPVOID lpBuf,
575     _In_ DWORD dwBufLen);
576 
577 BOOL WINAPI ImmGetCompositionWindow(_In_ HIMC hIMC, _Out_ LPCOMPOSITIONFORM lpCompForm);
578 HIMC WINAPI ImmGetContext(_In_ HWND hWnd);
579 
580 DWORD
581 WINAPI
582 ImmGetConversionListA(
583     _In_ HKL hKL,
584     _In_ HIMC hIMC,
585     _In_ LPCSTR lpSrc,
586     _Out_writes_bytes_(dwBufLen) LPCANDIDATELIST lpDst,
587     _In_ DWORD dwBufLen,
588     _In_ UINT uFlag);
589 
590 DWORD
591 WINAPI
592 ImmGetConversionListW(
593     _In_ HKL hKL,
594     _In_ HIMC hIMC,
595     _In_ LPCWSTR lpSrc,
596     _Out_writes_bytes_(dwBufLen) LPCANDIDATELIST lpDst,
597     _In_ DWORD dwBufLen,
598     _In_ UINT uFlag);
599 
600 BOOL
601 WINAPI
602 ImmGetConversionStatus(
603     _In_ HIMC hIMC,
604     _Out_opt_ LPDWORD lpfdwConversion,
605     _Out_opt_ LPDWORD lpfdwSentence);
606 
607 HWND WINAPI ImmGetDefaultIMEWnd(_In_ HWND hWnd);
608 
609 UINT
610 WINAPI
611 ImmGetDescriptionA(
612     _In_ HKL hKL,
613     _Out_writes_opt_(uBufLen) LPSTR lpszDescription,
614     _In_ UINT uBufLen);
615 
616 UINT
617 WINAPI
618 ImmGetDescriptionW(
619     _In_ HKL hKL,
620     _Out_writes_opt_(uBufLen) LPWSTR lpszDescription,
621     _In_ UINT uBufLen);
622 
623 DWORD
624 WINAPI
625 ImmGetGuideLineA(
626     _In_ HIMC hIMC,
627     _In_ DWORD dwIndex,
628     _Out_writes_bytes_opt_(dwBufLen) LPSTR lpBuf,
629     _In_ DWORD dwBufLen);
630 
631 DWORD
632 WINAPI
633 ImmGetGuideLineW(
634     _In_ HIMC hIMC,
635     _In_ DWORD dwIndex,
636     _Out_writes_bytes_opt_(dwBufLen) LPWSTR lpBuf,
637     _In_ DWORD dwBufLen);
638 
639 UINT
640 WINAPI
641 ImmGetIMEFileNameA(
642     _In_ HKL hKL,
643     _Out_writes_opt_(uBufLen) LPSTR lpszFileName,
644     _In_ UINT uBufLen);
645 
646 UINT
647 WINAPI
648 ImmGetIMEFileNameW(
649     _In_ HKL hKL,
650     _Out_writes_opt_(uBufLen) LPWSTR lpszFileName,
651     _In_ UINT uBufLen);
652 
653 #if (WINVER >= 0x040A)
654 
655 DWORD
656 WINAPI
657 ImmGetImeMenuItemsA(
658     _In_ HIMC hIMC,
659     _In_ DWORD dwFlags,
660     _In_ DWORD dwType,
661     _Out_opt_ LPIMEMENUITEMINFOA lpImeParentMenu,
662     _Out_writes_bytes_opt_(dwSize) LPIMEMENUITEMINFOA lpImeMenu,
663     _In_ DWORD dwSize);
664 
665 DWORD
666 WINAPI
667 ImmGetImeMenuItemsW(
668     _In_ HIMC hIMC,
669     _In_ DWORD dwFlags,
670     _In_ DWORD dwType,
671     _Out_opt_ LPIMEMENUITEMINFOW lpImeParentMenu,
672     _Out_writes_bytes_opt_(dwSize) LPIMEMENUITEMINFOW lpImeMenu,
673     _In_ DWORD dwSize);
674 
675 #ifdef UNICODE
676     #define ImmGetImeMenuItems ImmGetImeMenuItemsW
677 #else
678     #define ImmGetImeMenuItems ImmGetImeMenuItemsA
679 #endif
680 
681 #endif /* WINVER >= 0x040A */
682 
683 BOOL WINAPI ImmGetOpenStatus(_In_ HIMC hIMC);
684 DWORD WINAPI ImmGetProperty(_In_ HKL hKL, _In_ DWORD fdwIndex);
685 
686 UINT
687 WINAPI
688 ImmGetRegisterWordStyleA(
689     _In_ HKL hKL,
690     _In_ UINT nItem,
691     _Out_writes_(nItem) LPSTYLEBUFA lpStyleBuf);
692 
693 UINT
694 WINAPI
695 ImmGetRegisterWordStyleW(
696     _In_ HKL hKL,
697     _In_ UINT nItem,
698     _Out_writes_(nItem) LPSTYLEBUFW lpStyleBuf);
699 
700 BOOL WINAPI ImmGetStatusWindowPos(_In_ HIMC hIMC, _Out_ LPPOINT lpptPos);
701 UINT WINAPI ImmGetVirtualKey(_In_ HWND hWnd);
702 
703 HKL WINAPI ImmInstallIMEA(_In_ LPCSTR lpszIMEFileName, _In_ LPCSTR lpszLayoutText);
704 HKL WINAPI ImmInstallIMEW(_In_ LPCWSTR lpszIMEFileName, _In_ LPCWSTR lpszLayoutText);
705 
706 BOOL WINAPI ImmIsIME(_In_ HKL hKL);
707 
708 BOOL WINAPI
709 ImmIsUIMessageA(
710     _In_ HWND hWndIME,
711     _In_ UINT msg,
712     _In_ WPARAM wParam,
713     _In_ LPARAM lParam);
714 
715 BOOL WINAPI
716 ImmIsUIMessageW(
717     _In_ HWND hWndIME,
718     _In_ UINT msg,
719     _In_ WPARAM wParam,
720     _In_ LPARAM lParam);
721 
722 BOOL WINAPI
723 ImmNotifyIME(
724     _In_ HIMC hIMC,
725     _In_ DWORD dwAction,
726     _In_ DWORD dwIndex,
727     _In_ DWORD_PTR dwValue);
728 
729 BOOL
730 WINAPI
731 ImmRegisterWordA(
732     _In_ HKL hKL,
733     _In_ LPCSTR lpszReading,
734     _In_ DWORD dwStyle,
735     _In_ LPCSTR lpszRegister);
736 
737 BOOL
738 WINAPI
739 ImmRegisterWordW(
740     _In_ HKL hKL,
741     _In_ LPCWSTR lpszReading,
742     _In_ DWORD dwStyle,
743     _In_ LPCWSTR lpszRegister);
744 
745 BOOL WINAPI ImmReleaseContext(_In_ HWND hWnd, _In_ HIMC hIMC);
746 BOOL WINAPI ImmSetCandidateWindow(_In_ HIMC hIMC, _In_ LPCANDIDATEFORM lpCandidate);
747 
748 BOOL
749 WINAPI
750 ImmSetCompositionStringA(
751     _In_ HIMC hIMC,
752     _In_ DWORD dwIndex,
753     _Inout_updates_bytes_opt_(dwCompLen) LPVOID lpComp,
754     _In_ DWORD dwCompLen,
755     _Inout_updates_bytes_opt_(dwReadLen) LPVOID lpRead,
756     _In_ DWORD dwReadLen);
757 
758 BOOL
759 WINAPI
760 ImmSetCompositionStringW(
761     _In_ HIMC hIMC,
762     _In_ DWORD dwIndex,
763     _Inout_updates_bytes_opt_(dwCompLen) LPVOID lpComp,
764     _In_ DWORD dwCompLen,
765     _Inout_updates_bytes_opt_(dwReadLen) LPVOID lpRead,
766     _In_ DWORD dwReadLen);
767 
768 BOOL WINAPI ImmSetCompositionWindow(_In_ HIMC hIMC, _In_ LPCOMPOSITIONFORM lpCompForm);
769 
770 BOOL WINAPI
771 ImmSetConversionStatus(
772     _In_ HIMC hIMC,
773     _In_ DWORD fdwConversion,
774     _In_ DWORD fdwSentence);
775 
776 BOOL WINAPI ImmSetOpenStatus(_In_ HIMC hIMC, _In_ BOOL fOpen);
777 BOOL WINAPI ImmSetStatusWindowPos(_In_ HIMC hIMC, _In_ LPPOINT lpptPos);
778 BOOL WINAPI ImmSimulateHotKey(_In_ HWND hWnd, _In_ DWORD dwHotKeyID);
779 
780 BOOL
781 WINAPI
782 ImmUnregisterWordA(
783     _In_ HKL hKL,
784     _In_ LPCSTR lpszReading,
785     _In_ DWORD dwStyle,
786     _In_ LPCSTR lpszUnregister);
787 
788 BOOL
789 WINAPI
790 ImmUnregisterWordW(
791     _In_ HKL hKL,
792     _In_ LPCWSTR lpszReading,
793     _In_ DWORD dwStyle,
794     _In_ LPCWSTR lpszUnregister);
795 
796 #ifdef UNICODE
797     #define ImmConfigureIME ImmConfigureIMEW
798     #define ImmEnumRegisterWord ImmEnumRegisterWordW
799     #define ImmEscape ImmEscapeW
800     #define ImmGetCandidateList ImmGetCandidateListW
801     #define ImmGetCandidateListCount ImmGetCandidateListCountW
802     #define ImmGetCompositionString ImmGetCompositionStringW
803     #define ImmGetConversionList ImmGetConversionListW
804     #define ImmGetDescription ImmGetDescriptionW
805     #define ImmGetGuideLine ImmGetGuideLineW
806     #define ImmGetIMEFileName ImmGetIMEFileNameW
807     #define ImmGetRegisterWordStyle ImmGetRegisterWordStyleW
808     #define ImmInstallIME ImmInstallIMEW
809     #define ImmIsUIMessage ImmIsUIMessageW
810     #define ImmRegisterWord ImmRegisterWordW
811     #define ImmSetCompositionFont ImmSetCompositionFontW
812     #define ImmSetCompositionString ImmSetCompositionStringW
813     #define ImmUnregisterWord ImmUnregisterWordW
814     typedef LPSTYLEBUFW LPSTYLEBUF;
815     typedef NPSTYLEBUFW NPSTYLEBUF;
816     typedef PSTYLEBUFW PSTYLEBUF;
817     typedef REGISTERWORDENUMPROCW REGISTERWORDENUMPROC;
818     typedef STYLEBUFW STYLEBUF;
819 #else
820     #define ImmConfigureIME ImmConfigureIMEA
821     #define ImmEnumRegisterWord ImmEnumRegisterWordA
822     #define ImmEscape ImmEscapeA
823     #define ImmGetCandidateList ImmGetCandidateListA
824     #define ImmGetCandidateListCount ImmGetCandidateListCountA
825     #define ImmGetCompositionString ImmGetCompositionStringA
826     #define ImmGetConversionList ImmGetConversionListA
827     #define ImmGetDescription ImmGetDescriptionA
828     #define ImmGetGuideLine ImmGetGuideLineA
829     #define ImmGetIMEFileName ImmGetIMEFileNameA
830     #define ImmGetRegisterWordStyle ImmGetRegisterWordStyleA
831     #define ImmInstallIME ImmInstallIMEA
832     #define ImmIsUIMessage ImmIsUIMessageA
833     #define ImmRegisterWord ImmRegisterWordA
834     #define ImmSetCompositionFont ImmSetCompositionFontA
835     #define ImmSetCompositionString ImmSetCompositionStringA
836     #define ImmUnregisterWord ImmUnregisterWordA
837     typedef LPSTYLEBUFA LPSTYLEBUF;
838     typedef NPSTYLEBUFA NPSTYLEBUF;
839     typedef PSTYLEBUFA PSTYLEBUF;
840     typedef REGISTERWORDENUMPROCA REGISTERWORDENUMPROC;
841     typedef STYLEBUFA STYLEBUF;
842 #endif
843 
844 #ifdef __cplusplus
845 }
846 #endif
847 
848 #endif  /* __WINE_IMM_H */
849