ReactOS 0.4.15-dev-5666-gc548b97
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-2022 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
20/* wParam for WM_IME_CONTROL */
21#define IMC_GETCONVERSIONMODE 0x0001
22#define IMC_GETSENTENCEMODE 0x0003
23#define IMC_GETOPENSTATUS 0x0005
24#define IMC_GETSOFTKBDPOS 0x0013
25#define IMC_SETSOFTKBDPOS 0x0014
26
27/* wParam for WM_IME_SYSTEM */
28#define IMS_NOTIFYIMESHOW 0x05
29#define IMS_UPDATEIMEUI 0x06
30#define IMS_SETCANDFORM 0x09
31#define IMS_SETCOMPFONT 0x0A
32#define IMS_SETCOMPFORM 0x0B
33#define IMS_CONFIGURE 0x0D
34#define IMS_SETOPENSTATUS 0x0F
35#define IMS_FREELAYOUT 0x11
36#define IMS_GETCONVSTATUS 0x14
37#define IMS_IMEHELP 0x15
38#define IMS_IMEACTIVATE 0x17
39#define IMS_IMEDEACTIVATE 0x18
40#define IMS_ACTIVATELAYOUT 0x19
41#define IMS_GETIMEMENU 0x1C
42#define IMS_GETCONTEXT 0x1E
43#define IMS_SENDNOTIFICATION 0x1F
44#define IMS_COMPLETECOMPSTR 0x20
45#define IMS_LOADTHREADLAYOUT 0x21
46#define IMS_SETLANGBAND 0x23
47#define IMS_UNSETLANGBAND 0x24
48
49#define IMMGWL_IMC 0
50#define IMMGWL_PRIVATE (sizeof(LONG))
51
52#define IMMGWLP_IMC 0
53#define IMMGWLP_PRIVATE (sizeof(LONG_PTR))
54
55typedef struct _tagINPUTCONTEXT {
62 union {
77
78#ifdef _WIN64
80C_ASSERT(offsetof(INPUTCONTEXT, fOpen) == 0x8);
81C_ASSERT(offsetof(INPUTCONTEXT, ptStatusWndPos) == 0xc);
82C_ASSERT(offsetof(INPUTCONTEXT, ptSoftKbdPos) == 0x14);
83C_ASSERT(offsetof(INPUTCONTEXT, fdwConversion) == 0x1c);
84C_ASSERT(offsetof(INPUTCONTEXT, fdwSentence) == 0x20);
85C_ASSERT(offsetof(INPUTCONTEXT, lfFont) == 0x24);
86C_ASSERT(offsetof(INPUTCONTEXT, cfCompForm) == 0x80);
87C_ASSERT(offsetof(INPUTCONTEXT, cfCandForm) == 0x9c);
88C_ASSERT(offsetof(INPUTCONTEXT, hCompStr) == 0x120);
89C_ASSERT(offsetof(INPUTCONTEXT, hCandInfo) == 0x128);
90C_ASSERT(offsetof(INPUTCONTEXT, hGuideLine) == 0x130);
91C_ASSERT(offsetof(INPUTCONTEXT, hPrivate) == 0x138);
92C_ASSERT(offsetof(INPUTCONTEXT, dwNumMsgBuf) == 0x140);
93C_ASSERT(offsetof(INPUTCONTEXT, hMsgBuf) == 0x148);
94C_ASSERT(offsetof(INPUTCONTEXT, fdwInit) == 0x150);
95C_ASSERT(offsetof(INPUTCONTEXT, dwReserve) == 0x154);
96C_ASSERT(sizeof(INPUTCONTEXT) == 0x160);
97#else
100C_ASSERT(offsetof(INPUTCONTEXT, ptStatusWndPos) == 0x8);
101C_ASSERT(offsetof(INPUTCONTEXT, ptSoftKbdPos) == 0x10);
102C_ASSERT(offsetof(INPUTCONTEXT, fdwConversion) == 0x18);
103C_ASSERT(offsetof(INPUTCONTEXT, fdwSentence) == 0x1c);
105C_ASSERT(offsetof(INPUTCONTEXT, cfCompForm) == 0x7c);
106C_ASSERT(offsetof(INPUTCONTEXT, cfCandForm) == 0x98);
107C_ASSERT(offsetof(INPUTCONTEXT, hCompStr) == 0x118);
108C_ASSERT(offsetof(INPUTCONTEXT, hCandInfo) == 0x11c);
109C_ASSERT(offsetof(INPUTCONTEXT, hGuideLine) == 0x120);
110C_ASSERT(offsetof(INPUTCONTEXT, hPrivate) == 0x124);
111C_ASSERT(offsetof(INPUTCONTEXT, dwNumMsgBuf) == 0x128);
112C_ASSERT(offsetof(INPUTCONTEXT, hMsgBuf) == 0x12c);
113C_ASSERT(offsetof(INPUTCONTEXT, fdwInit) == 0x130);
114C_ASSERT(offsetof(INPUTCONTEXT, dwReserve) == 0x134);
115C_ASSERT(sizeof(INPUTCONTEXT) == 0x140);
116#endif
117
118struct IME_STATE;
119
120/* unconfirmed */
121#ifdef __cplusplus
122typedef struct INPUTCONTEXTDX : INPUTCONTEXT
123{
124#else
125typedef struct INPUTCONTEXTDX
126{
128#endif
138
139#ifndef _WIN64
145C_ASSERT(sizeof(INPUTCONTEXTDX) == 0x160);
146#endif
147
148// bits of fdwInit of INPUTCONTEXT
149#define INIT_STATUSWNDPOS 0x00000001
150#define INIT_CONVERSION 0x00000002
151#define INIT_SENTENCE 0x00000004
152#define INIT_LOGFONT 0x00000008
153#define INIT_COMPFORM 0x00000010
154#define INIT_SOFTKBDPOS 0x00000020
155
156// bits for INPUTCONTEXTDX.dwChange
157#define INPUTCONTEXTDX_CHANGE_OPEN 0x1
158#define INPUTCONTEXTDX_CHANGE_CONVERSION 0x2
159#define INPUTCONTEXTDX_CHANGE_SENTENCE 0x4
160#define INPUTCONTEXTDX_CHANGE_FORCE_OPEN 0x100
161
162#ifndef WM_IME_REPORT
163 #define WM_IME_REPORT 0x280
164#endif
165
166// WM_IME_REPORT wParam
167#define IR_STRINGSTART 0x100
168#define IR_STRINGEND 0x101
169#define IR_OPENCONVERT 0x120
170#define IR_CHANGECONVERT 0x121
171#define IR_CLOSECONVERT 0x122
172#define IR_FULLCONVERT 0x123
173#define IR_IMESELECT 0x130
174#define IR_STRING 0x140
175#define IR_DBCSCHAR 0x160
176#define IR_UNDETERMINE 0x170
177#define IR_STRINGEX 0x180
178#define IR_MODEINFO 0x190
179
180// for IR_UNDETERMINE
182{
198
200
201typedef struct IME_SUBSTATE
202{
207
208#ifndef _WIN64
209C_ASSERT(sizeof(IME_SUBSTATE) == 0xc);
210#endif
211
212typedef struct IME_STATE
213{
222
223#ifndef _WIN64
224C_ASSERT(sizeof(IME_STATE) == 0x18);
225#endif
226
227#ifdef __cplusplus
228} // extern "C"
229#endif
230
231#endif /* ndef _IMMDEV_ */
HWND hWnd
Definition: settings.c:17
DWORD HIMCC
Definition: dimm.idl:76
DWORD HIMC
Definition: dimm.idl:75
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
struct tagUNDETERMINESTRUCT * PUNDETERMINESTRUCT
struct _tagINPUTCONTEXT * LPINPUTCONTEXT
struct IME_SUBSTATE * PIME_SUBSTATE
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
struct _tagINPUTCONTEXT INPUTCONTEXT
struct _tagINPUTCONTEXT * PINPUTCONTEXT
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC)
Definition: imm.c:1070
struct tagUNDETERMINESTRUCT * LPUNDETERMINESTRUCT
struct IME_STATE * PIME_STATE
struct tagUNDETERMINESTRUCT UNDETERMINESTRUCT
struct INPUTCONTEXTDX * PINPUTCONTEXTDX
#define C_ASSERT(e)
Definition: intsafe.h:73
UINT_PTR HKL
Definition: msctf.idl:104
unsigned int UINT
Definition: ndis.h:50
#define offsetof(TYPE, MEMBER)
DWORD dwConversion
Definition: immdev.h:217
WORD fOpen
Definition: immdev.h:216
WORD wLang
Definition: immdev.h:215
PIME_SUBSTATE pSubState
Definition: immdev.h:220
DWORD dwInit
Definition: immdev.h:219
DWORD dwSentence
Definition: immdev.h:218
struct IME_STATE * pNext
Definition: immdev.h:214
struct IME_SUBSTATE * pNext
Definition: immdev.h:203
DWORD dwValue
Definition: immdev.h:205
DWORD dwUnknown1
Definition: immdev.h:131
DWORD dwUnknown5
Definition: immdev.h:136
DWORD dwUnknown2
Definition: immdev.h:133
struct IME_STATE * pState
Definition: immdev.h:134
DWORD dwChange
Definition: immdev.h:135
DWORD dwUIFlags
Definition: immdev.h:132
UINT nVKey
Definition: immdev.h:129
BOOL bNeedsTrans
Definition: immdev.h:130
POINT ptStatusWndPos
Definition: immdev.h:58
HIMCC hPrivate
Definition: immdev.h:71
COMPOSITIONFORM cfCompForm
Definition: immdev.h:66
CANDIDATEFORM cfCandForm[4]
Definition: immdev.h:67
HIMCC hMsgBuf
Definition: immdev.h:73
DWORD fdwInit
Definition: immdev.h:74
POINT ptSoftKbdPos
Definition: immdev.h:59
HIMCC hCompStr
Definition: immdev.h:68
DWORD fdwConversion
Definition: immdev.h:60
union _tagINPUTCONTEXT::@2026 lfFont
DWORD dwReserve[3]
Definition: immdev.h:75
HIMCC hCandInfo
Definition: immdev.h:69
HIMCC hGuideLine
Definition: immdev.h:70
LOGFONTA A
Definition: immdev.h:63
DWORD fdwSentence
Definition: immdev.h:61
DWORD dwNumMsgBuf
Definition: immdev.h:72
LOGFONTW W
Definition: immdev.h:64
UINT uDetermineDelimPos
Definition: immdev.h:193
UINT uDetermineTextPos
Definition: immdev.h:192
UINT uDetermineTextLen
Definition: immdev.h:191
#define WINAPI
Definition: msvc.h:6