ReactOS 0.4.16-dev-1279-gc894716
immdev.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS headers
3 * LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
4 * PURPOSE: Providing DDK-compatible <immdev.h> and IME/IMM development helper
5 * COPYRIGHT: Copyright 2021-2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#ifndef _IMMDEV_
9#define _IMMDEV_
10
11#pragma once
12
13#include <wingdi.h>
14#include <imm.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20typedef struct _tagIMEINFO {
29
30typedef struct tagCANDIDATEINFO {
37
38#if (WINVER >= 0x040A)
40#endif
41
42typedef struct tagSOFTKBDDATA {
46
47typedef struct tagCOMPOSITIONSTRING {
74
75typedef struct tagGUIDELINE {
84
85/* wParam for WM_IME_CONTROL */
86#define IMC_GETCONVERSIONMODE 0x0001
87#define IMC_GETSENTENCEMODE 0x0003
88#define IMC_GETOPENSTATUS 0x0005
89#define IMC_GETSOFTKBDFONT 0x0011
90#define IMC_SETSOFTKBDFONT 0x0012
91#define IMC_GETSOFTKBDPOS 0x0013
92#define IMC_SETSOFTKBDPOS 0x0014
93#define IMC_GETSOFTKBDSUBTYPE 0x0015
94#define IMC_SETSOFTKBDSUBTYPE 0x0016
95#define IMC_SETSOFTKBDDATA 0x0018
96
97/* wParam for WM_IME_NOTIFY */
98#define IMN_SOFTKBDDESTROYED 0x0011
99
100#define IMMGWL_IMC 0
101#define IMMGWL_PRIVATE (sizeof(LONG))
102
103#define IMMGWLP_IMC 0
104#define IMMGWLP_PRIVATE (sizeof(LONG_PTR))
105
106typedef struct _tagINPUTCONTEXT {
113 union {
128
129#ifndef _WIN64
132C_ASSERT(offsetof(INPUTCONTEXT, ptStatusWndPos) == 0x8);
133C_ASSERT(offsetof(INPUTCONTEXT, ptSoftKbdPos) == 0x10);
134C_ASSERT(offsetof(INPUTCONTEXT, fdwConversion) == 0x18);
135C_ASSERT(offsetof(INPUTCONTEXT, fdwSentence) == 0x1C);
137C_ASSERT(offsetof(INPUTCONTEXT, cfCompForm) == 0x7C);
138C_ASSERT(offsetof(INPUTCONTEXT, cfCandForm) == 0x98);
139C_ASSERT(offsetof(INPUTCONTEXT, hCompStr) == 0x118);
140C_ASSERT(offsetof(INPUTCONTEXT, hCandInfo) == 0x11C);
141C_ASSERT(offsetof(INPUTCONTEXT, hGuideLine) == 0x120);
142C_ASSERT(offsetof(INPUTCONTEXT, hPrivate) == 0x124);
143C_ASSERT(offsetof(INPUTCONTEXT, dwNumMsgBuf) == 0x128);
144C_ASSERT(offsetof(INPUTCONTEXT, hMsgBuf) == 0x12C);
145C_ASSERT(offsetof(INPUTCONTEXT, fdwInit) == 0x130);
146C_ASSERT(offsetof(INPUTCONTEXT, dwReserve) == 0x134);
147C_ASSERT(sizeof(INPUTCONTEXT) == 0x140);
148#endif
149
150/* bits of fdwInit of INPUTCONTEXT */
151#define INIT_STATUSWNDPOS 0x00000001
152#define INIT_CONVERSION 0x00000002
153#define INIT_SENTENCE 0x00000004
154#define INIT_LOGFONT 0x00000008
155#define INIT_COMPFORM 0x00000010
156#define INIT_SOFTKBDPOS 0x00000020
157#define INIT_GUIDMAP 0x00000040
158
159/* bits for INPUTCONTEXTDX.dwChange */
160#define INPUTCONTEXTDX_CHANGE_OPEN 0x1
161#define INPUTCONTEXTDX_CHANGE_CONVERSION 0x2
162#define INPUTCONTEXTDX_CHANGE_SENTENCE 0x4
163#define INPUTCONTEXTDX_CHANGE_FORCE_OPEN 0x100
164
165#ifndef WM_IME_REPORT
166 #define WM_IME_REPORT 0x280
167#endif
168
169/* WM_IME_REPORT wParam */
170#define IR_STRINGSTART 0x100
171#define IR_STRINGEND 0x101
172#define IR_OPENCONVERT 0x120
173#define IR_CHANGECONVERT 0x121
174#define IR_CLOSECONVERT 0x122
175#define IR_FULLCONVERT 0x123
176#define IR_IMESELECT 0x130
177#define IR_STRING 0x140
178#define IR_DBCSCHAR 0x160
179#define IR_UNDETERMINE 0x170
180#define IR_STRINGEX 0x180
181#define IR_MODEINFO 0x190
182
183/* IMC */
184
188
189/* IMCC */
190
198
199/* Messaging */
200
202
205 _In_ HWND hwnd,
206 _In_ UINT msg,
208 _In_ LPARAM lKeyData);
209
212
213#ifdef UNICODE
214 #define ImmRequestMessage ImmRequestMessageW
215#else
216 #define ImmRequestMessage ImmRequestMessageA
217#endif
218
219typedef struct _tagTRANSMSG {
224
225typedef struct _tagTRANSMSGLIST {
229
230/* Soft keyboard */
231
234 _In_ UINT uType,
236 _In_ INT x,
237 _In_ INT y);
238
241 _In_ HWND hwndSoftKBD,
242 _In_ INT nCmdShow);
243
246 _In_ HWND hwndSoftKBD);
247
248/* IME file interface */
249
252 _Out_ LPIMEINFO lpIMEInfo,
253 _Out_ LPTSTR lpszWndClass,
254 _In_ DWORD dwSystemInfoFlags);
255
258 _In_ HIMC hIMC,
259 _In_ LPCTSTR lpSrc,
262 _In_ UINT uFlag);
263
266 _In_ LPCTSTR lpszReading,
267 _In_ DWORD dwStyle,
268 _In_ LPCTSTR lpszString);
269
272 _In_ LPCTSTR lpszReading,
273 _In_ DWORD dwStyle,
274 _In_ LPCTSTR lpszString);
275
278 _In_ UINT nItem,
279 _Out_ LPSTYLEBUF lpStyleBuf);
280
283 _In_ REGISTERWORDENUMPROC lpfnEnumProc,
284 _In_opt_ LPCTSTR lpszReading,
285 _In_ DWORD dwStyle,
286 _In_opt_ LPCTSTR lpszString,
287 _In_opt_ LPVOID lpData);
288
291 _In_ HKL hKL,
292 _In_ HWND hWnd,
293 _In_ DWORD dwMode,
294 _Inout_opt_ LPVOID lpData);
295
298 _In_ UINT uReserved);
299
302 _In_ HIMC hIMC,
303 _In_ UINT uEscape,
304 _Inout_opt_ LPVOID lpData);
305
308 _In_ HIMC hIMC,
309 _In_ UINT uVirKey,
311 _In_ CONST LPBYTE lpbKeyState);
312
315 _In_ HIMC hIMC,
316 _In_ BOOL fSelect);
317
320 _In_ HIMC hIMC,
321 _In_ BOOL fFlag);
322
325 _In_ UINT uVirKey,
326 _In_ UINT uScanCode,
327 _In_ CONST LPBYTE lpbKeyState,
328 _Out_ LPTRANSMSGLIST lpTransMsgList,
329 _In_ UINT fuState,
330 _In_ HIMC hIMC);
331
334 _In_ HIMC hIMC,
335 _In_ DWORD dwAction,
336 _In_ DWORD dwIndex,
337 _In_ DWORD_PTR dwValue);
338
341 _In_ HIMC hIMC,
342 _In_ DWORD dwIndex,
343 _In_opt_ LPCVOID lpComp,
344 _In_ DWORD dwCompLen,
345 _In_opt_ LPCVOID lpRead,
346 _In_ DWORD dwReadLen);
347
350 _In_ HIMC hIMC,
352 _In_ DWORD dwType,
353 _Inout_opt_ LPIMEMENUITEMINFO lpImeParentMenu,
354 _Inout_opt_ LPIMEMENUITEMINFO lpImeMenu,
356
357#ifdef __cplusplus
358} /* extern "C" */
359#endif
360
361/* IME Property bits */
362#define IME_PROP_END_UNLOAD 0x0001
363#define IME_PROP_KBD_CHAR_FIRST 0x0002
364#define IME_PROP_IGNORE_UPKEYS 0x0004
365#define IME_PROP_NEED_ALTKEY 0x0008
366#define IME_PROP_NO_KEYS_ON_CLOSE 0x0010
367#define IME_PROP_ACCEPT_WIDE_VKEY 0x0020
368
369/* for NI_CONTEXTUPDATED */
370#define IMC_SETCONVERSIONMODE 0x0002
371#define IMC_SETSENTENCEMODE 0x0004
372#define IMC_SETOPENSTATUS 0x0006
373
374/* dwAction for ImmNotifyIME */
375#define NI_CONTEXTUPDATED 0x0003
376#define NI_OPENCANDIDATE 0x0010
377#define NI_CLOSECANDIDATE 0x0011
378#define NI_SELECTCANDIDATESTR 0x0012
379#define NI_CHANGECANDIDATELIST 0x0013
380#define NI_FINALIZECONVERSIONRESULT 0x0014
381#define NI_COMPOSITIONSTR 0x0015
382#define NI_SETCANDIDATE_PAGESTART 0x0016
383#define NI_SETCANDIDATE_PAGESIZE 0x0017
384#define NI_IMEMENUSELECTED 0x0018
385
386/* dwSystemInfoFlags bits */
387#define IME_SYSINFO_WINLOGON 0x0001
388#define IME_SYSINFO_WOW16 0x0002
389
390#endif /* ndef _IMMDEV_ */
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static HWND hwndParent
Definition: cryptui.c:300
BOOL WINAPI ImmDisableTextFrameService(_In_ DWORD dwThreadId)
Definition: ctf.c:1088
DWORD HIMCC
Definition: dimm.idl:76
DWORD HIMC
Definition: dimm.idl:75
#define FAR
Definition: zlib.h:34
DWORD dwThreadId
Definition: fdebug.c:31
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLsizeiptr size
Definition: glext.h:5919
REGISTERWORDENUMPROCA REGISTERWORDENUMPROC
Definition: imm.h:840
struct tagCANDIDATEINFO * NPCANDIDATEINFO
LRESULT WINAPI ImmRequestMessageA(_In_ HIMC hIMC, _In_ WPARAM wParam, _In_ LPARAM lParam)
Definition: keymsg.c:1162
struct _tagIMEINFO * PIMEINFO
DWORD WINAPI ImmGetIMCCSize(_In_ HIMCC imcc)
Definition: utils.c:648
struct _tagTRANSMSGLIST * PTRANSMSGLIST
struct tagGUIDELINE GUIDELINE
DWORD WINAPI ImeConversionList(_In_ HIMC hIMC, _In_ LPCTSTR lpSrc, _Out_ LPCANDIDATELIST lpDst, _In_ DWORD dwBufLen, _In_ UINT uFlag)
struct _tagTRANSMSG * NPTRANSMSG
BOOL WINAPI ImmUnlockIMCC(_In_ HIMCC imcc)
Definition: utils.c:615
struct tagCANDIDATEINFO * PCANDIDATEINFO
LPINPUTCONTEXT WINAPI ImmLockIMC(_In_ HIMC hIMC)
Definition: imm.c:1079
BOOL WINAPI ImmTranslateMessage(_In_ HWND hwnd, _In_ UINT msg, _In_ WPARAM wParam, _In_ LPARAM lKeyData)
Definition: keymsg.c:1020
struct tagSOFTKBDDATA * LPSOFTKBDDATA
struct _tagINPUTCONTEXT * NPINPUTCONTEXT
struct tagSOFTKBDDATA SOFTKBDDATA
BOOL WINAPI ImeProcessKey(_In_ HIMC hIMC, _In_ UINT uVirKey, _In_ LPARAM lParam, _In_ CONST LPBYTE lpbKeyState)
Definition: msctfime.cpp:364
HIMCC WINAPI ImmReSizeIMCC(_In_ HIMCC imcc, _In_ DWORD size)
Definition: utils.c:635
struct tagGUIDELINE * NPGUIDELINE
struct _tagTRANSMSG TRANSMSG
UINT WINAPI ImeEnumRegisterWord(_In_ REGISTERWORDENUMPROC lpfnEnumProc, _In_opt_ LPCTSTR lpszReading, _In_ DWORD dwStyle, _In_opt_ LPCTSTR lpszString, _In_opt_ LPVOID lpData)
struct _tagTRANSMSG * LPTRANSMSG
HIMCC WINAPI ImmDestroyIMCC(_In_ HIMCC block)
Definition: utils.c:593
struct _tagIMEINFO * NPIMEINFO
struct tagCOMPOSITIONSTRING * PCOMPOSITIONSTRING
LRESULT WINAPI ImeEscape(_In_ HIMC hIMC, _In_ UINT uEscape, _Inout_opt_ LPVOID lpData)
Definition: msctfime.cpp:348
BOOL WINAPI ImeSelect(_In_ HIMC hIMC, _In_ BOOL fSelect)
Definition: msctfime.cpp:418
struct tagCOMPOSITIONSTRING * LPCOMPOSITIONSTRING
BOOL WINAPI ImmGenerateMessage(_In_ HIMC hIMC)
Definition: keymsg.c:878
DWORD WINAPI ImmGetIMCCLockCount(_In_ HIMCC imcc)
Definition: utils.c:626
BOOL WINAPI ImeDestroy(_In_ UINT uReserved)
Definition: msctfime.cpp:317
struct tagCANDIDATEINFO CANDIDATEINFO
struct tagCANDIDATEINFO * LPCANDIDATEINFO
BOOL WINAPI ImmDestroySoftKeyboard(_In_ HWND hwndSoftKBD)
Definition: softkbd.c:2220
BOOL WINAPI ImeSetActiveContext(_In_ HIMC hIMC, _In_ BOOL fFlag)
Definition: msctfime.cpp:436
struct tagGUIDELINE * LPGUIDELINE
BOOL WINAPI ImeInquire(_Out_ LPIMEINFO lpIMEInfo, _Out_ LPTSTR lpszWndClass, _In_ DWORD dwSystemInfoFlags)
BOOL WINAPI ImeSetCompositionString(_In_ HIMC hIMC, _In_ DWORD dwIndex, _In_opt_ LPCVOID lpComp, _In_ DWORD dwCompLen, _In_opt_ LPCVOID lpRead, _In_ DWORD dwReadLen)
Definition: msctfime.cpp:512
struct tagCOMPOSITIONSTRING * NPCOMPOSITIONSTRING
DWORD WINAPI ImmGetIMCLockCount(_In_ HIMC hIMC)
Definition: utils.c:659
BOOL WINAPI ImeConfigure(_In_ HKL hKL, _In_ HWND hWnd, _In_ DWORD dwMode, _Inout_opt_ LPVOID lpData)
Definition: msctfime.cpp:286
struct _tagINPUTCONTEXT INPUTCONTEXT
struct _tagTRANSMSGLIST TRANSMSGLIST
struct _tagINPUTCONTEXT * PINPUTCONTEXT
struct tagSOFTKBDDATA * PSOFTKBDDATA
struct tagGUIDELINE * PGUIDELINE
struct _tagIMEINFO IMEINFO
DWORD WINAPI ImeGetImeMenuItems(_In_ HIMC hIMC, _In_ DWORD dwFlags, _In_ DWORD dwType, _Inout_opt_ LPIMEMENUITEMINFO lpImeParentMenu, _Inout_opt_ LPIMEMENUITEMINFO lpImeMenu, _In_ DWORD dwSize)
HWND WINAPI ImmCreateSoftKeyboard(_In_ UINT uType, _In_ HWND hwndParent, _In_ INT x, _In_ INT y)
Definition: softkbd.c:2101
struct _tagINPUTCONTEXT * LPINPUTCONTEXT
BOOL WINAPI ImmUnlockIMC(_In_ HIMC hIMC)
Definition: imm.c:1089
BOOL WINAPI ImeRegisterWord(_In_ LPCTSTR lpszReading, _In_ DWORD dwStyle, _In_ LPCTSTR lpszString)
struct _tagTRANSMSGLIST * LPTRANSMSGLIST
struct tagSOFTKBDDATA * NPSOFTKBDDATA
LRESULT WINAPI ImmRequestMessageW(_In_ HIMC hIMC, _In_ WPARAM wParam, _In_ LPARAM lParam)
Definition: keymsg.c:1175
BOOL WINAPI ImeUnregisterWord(_In_ LPCTSTR lpszReading, _In_ DWORD dwStyle, _In_ LPCTSTR lpszString)
struct _tagIMEINFO * LPIMEINFO
UINT WINAPI ImeToAsciiEx(_In_ UINT uVirKey, _In_ UINT uScanCode, _In_ CONST LPBYTE lpbKeyState, _Out_ LPTRANSMSGLIST lpTransMsgList, _In_ UINT fuState, _In_ HIMC hIMC)
Definition: msctfime.cpp:451
BOOL WINAPI NotifyIME(_In_ HIMC hIMC, _In_ DWORD dwAction, _In_ DWORD dwIndex, _In_ DWORD_PTR dwValue)
Definition: msctfime.cpp:484
struct _tagTRANSMSGLIST * NPTRANSMSGLIST
UINT WINAPI ImeGetRegisterWordStyle(_In_ UINT nItem, _Out_ LPSTYLEBUF lpStyleBuf)
struct _tagTRANSMSG * PTRANSMSG
HIMCC WINAPI ImmCreateIMCC(_In_ DWORD size)
Definition: utils.c:582
struct tagCOMPOSITIONSTRING COMPOSITIONSTRING
BOOL WINAPI ImmShowSoftKeyboard(_In_ HWND hwndSoftKBD, _In_ INT nCmdShow)
Definition: softkbd.c:2202
LPVOID WINAPI ImmLockIMCC(_In_ HIMCC imcc)
Definition: utils.c:604
#define C_ASSERT(e)
Definition: intsafe.h:73
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
UINT_PTR HKL
Definition: msctf.idl:125
unsigned int UINT
Definition: ndis.h:50
#define _Inout_opt_
Definition: no_sal2.h:216
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define CONST
Definition: pedump.c:81
#define offsetof(TYPE, MEMBER)
DWORD fdwSelectCaps
Definition: immdev.h:27
DWORD fdwSentenceCaps
Definition: immdev.h:24
DWORD fdwConversionCaps
Definition: immdev.h:23
DWORD fdwSCSCaps
Definition: immdev.h:26
DWORD fdwProperty
Definition: immdev.h:22
DWORD dwPrivateDataSize
Definition: immdev.h:21
DWORD fdwUICaps
Definition: immdev.h:25
union _tagINPUTCONTEXT::@2167 lfFont
POINT ptStatusWndPos
Definition: immdev.h:109
HIMCC hPrivate
Definition: immdev.h:122
COMPOSITIONFORM cfCompForm
Definition: immdev.h:117
CANDIDATEFORM cfCandForm[4]
Definition: immdev.h:118
HIMCC hMsgBuf
Definition: immdev.h:124
DWORD fdwInit
Definition: immdev.h:125
POINT ptSoftKbdPos
Definition: immdev.h:110
HIMCC hCompStr
Definition: immdev.h:119
DWORD fdwConversion
Definition: immdev.h:111
DWORD dwReserve[3]
Definition: immdev.h:126
HIMCC hCandInfo
Definition: immdev.h:120
HIMCC hGuideLine
Definition: immdev.h:121
LOGFONTA A
Definition: immdev.h:114
DWORD fdwSentence
Definition: immdev.h:112
DWORD dwNumMsgBuf
Definition: immdev.h:123
LOGFONTW W
Definition: immdev.h:115
TRANSMSG TransMsg[ANYSIZE_ARRAY]
Definition: immdev.h:227
UINT uMsgCount
Definition: immdev.h:226
LPARAM lParam
Definition: imm32.c:68
WPARAM wParam
Definition: imm32.c:67
UINT message
Definition: imm32.c:66
DWORD dwPrivateOffset
Definition: immdev.h:35
DWORD dwSize
Definition: immdev.h:31
DWORD dwPrivateSize
Definition: immdev.h:34
DWORD dwOffset[32]
Definition: immdev.h:33
DWORD dwCount
Definition: immdev.h:32
DWORD dwCompReadStrOffset
Definition: immdev.h:54
DWORD dwCompReadAttrLen
Definition: immdev.h:49
DWORD dwResultStrOffset
Definition: immdev.h:70
DWORD dwCompStrOffset
Definition: immdev.h:60
DWORD dwPrivateSize
Definition: immdev.h:71
DWORD dwCompStrLen
Definition: immdev.h:59
DWORD dwResultReadStrOffset
Definition: immdev.h:66
DWORD dwCompClauseLen
Definition: immdev.h:57
DWORD dwDeltaStart
Definition: immdev.h:62
DWORD dwCompClauseOffset
Definition: immdev.h:58
DWORD dwCompAttrLen
Definition: immdev.h:55
DWORD dwResultClauseLen
Definition: immdev.h:67
DWORD dwResultStrLen
Definition: immdev.h:69
DWORD dwCompReadAttrOffset
Definition: immdev.h:50
DWORD dwCompReadClauseLen
Definition: immdev.h:51
DWORD dwCompAttrOffset
Definition: immdev.h:56
DWORD dwResultClauseOffset
Definition: immdev.h:68
DWORD dwResultReadStrLen
Definition: immdev.h:65
DWORD dwCompReadStrLen
Definition: immdev.h:53
DWORD dwResultReadClauseLen
Definition: immdev.h:63
DWORD dwResultReadClauseOffset
Definition: immdev.h:64
DWORD dwCompReadClauseOffset
Definition: immdev.h:52
DWORD dwPrivateOffset
Definition: immdev.h:72
DWORD dwStrOffset
Definition: immdev.h:80
DWORD dwPrivateSize
Definition: immdev.h:81
DWORD dwStrLen
Definition: immdev.h:79
DWORD dwIndex
Definition: immdev.h:78
DWORD dwSize
Definition: immdev.h:76
DWORD dwLevel
Definition: immdev.h:77
DWORD dwPrivateOffset
Definition: immdev.h:82
UINT uCount
Definition: immdev.h:43
WORD wCode[ANYSIZE_ARRAY][256]
Definition: immdev.h:44
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define ANYSIZE_ARRAY
Definition: typedefs.h:46
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4246
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define NEAR
Definition: windef.h:146
CONST void * LPCVOID
Definition: windef.h:191
#define WINAPI
Definition: msvc.h:6
static unsigned int block
Definition: xmlmemory.c:101
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
CHAR * LPTSTR
Definition: xmlstorage.h:192