Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

713 lines
26 KiB

  1. /**********************************************************************/
  2. /* IMM.H - Input Method Manager definitions */
  3. /* */
  4. /* Copyright (c) 1993-1995 Microsoft Corporation */
  5. /**********************************************************************/
  6. #ifndef _IMM_
  7. #define _IMM_ // defined if IMM.H has been included
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #ifndef _WINUSER_
  12. #define VK_PROCESSKEY 0x0E5
  13. #endif
  14. #ifndef IMM_WINVER
  15. #define IMM_WINVER 0x040A
  16. #endif
  17. //#if(IMM_WINVER >= 0x040A)
  18. //DECLARE_HANDLE(HIMC);
  19. //#else
  20. typedef DWORD HIMC;
  21. //#endif
  22. //#if(IMM_WINVER >= 0x040A)
  23. //DECLARE_HANDLE(HIMCC);
  24. //#else
  25. typedef DWORD HIMCC;
  26. //#endif
  27. typedef HKL FAR *LPHKL;
  28. typedef UINT FAR *LPUINT;
  29. #define NULLIMC ((HIMC)0)
  30. typedef struct tagCOMPOSITIONFORM {
  31. DWORD dwStyle;
  32. POINT ptCurrentPos;
  33. RECT rcArea;
  34. } COMPOSITIONFORM, *PCOMPOSITIONFORM, NEAR *NPCOMPOSITIONFORM, FAR *LPCOMPOSITIONFORM;
  35. typedef struct tagCANDIDATEFORM {
  36. DWORD dwIndex;
  37. DWORD dwStyle;
  38. POINT ptCurrentPos;
  39. RECT rcArea;
  40. } CANDIDATEFORM, *PCANDIDATEFORM, NEAR *NPCANDIDATEFORM, FAR *LPCANDIDATEFORM;
  41. typedef struct tagCANDIDATELIST {
  42. DWORD dwSize;
  43. DWORD dwStyle;
  44. DWORD dwCount;
  45. DWORD dwSelection;
  46. DWORD dwPageStart;
  47. DWORD dwPageSize;
  48. DWORD dwOffset[1];
  49. } CANDIDATELIST, *PCANDIDATELIST, NEAR *NPCANDIDATELIST, FAR *LPCANDIDATELIST;
  50. typedef struct tagREGISTERWORDA {
  51. LPSTR lpReading;
  52. LPSTR lpWord;
  53. } REGISTERWORDA, *PREGISTERWORDA, NEAR *NPREGISTERWORDA, FAR *LPREGISTERWORDA;
  54. typedef struct tagREGISTERWORDW {
  55. LPWSTR lpReading;
  56. LPWSTR lpWord;
  57. } REGISTERWORDW, *PREGISTERWORDW, NEAR *NPREGISTERWORDW, FAR *LPREGISTERWORDW;
  58. #ifdef UNICODE
  59. typedef REGISTERWORDW REGISTERWORD;
  60. typedef PREGISTERWORDW PREGISTERWORD;
  61. typedef NPREGISTERWORDW NPREGISTERWORD;
  62. typedef LPREGISTERWORDW LPREGISTERWORD;
  63. #else
  64. typedef REGISTERWORDA REGISTERWORD;
  65. typedef PREGISTERWORDA PREGISTERWORD;
  66. typedef NPREGISTERWORDA NPREGISTERWORD;
  67. typedef LPREGISTERWORDA LPREGISTERWORD;
  68. #endif // UNICODE
  69. #if(IMM_WINVER >= 0x040A)
  70. typedef struct tagRECONVERTSTRING {
  71. DWORD dwSize;
  72. DWORD dwVersion;
  73. DWORD dwStrLen;
  74. DWORD dwStrOffset;
  75. DWORD dwCompStrLen;
  76. DWORD dwCompStrOffset;
  77. DWORD dwTargetStrLen;
  78. DWORD dwTargetStrOffset;
  79. } RECONVERTSTRING, *PRECONVERTSTRING, NEAR *NPRECONVERTSTRING, FAR *LPRECONVERTSTRING;
  80. #endif
  81. #define STYLE_DESCRIPTION_SIZE 32
  82. typedef struct tagSTYLEBUFA {
  83. DWORD dwStyle;
  84. CHAR szDescription[STYLE_DESCRIPTION_SIZE];
  85. } STYLEBUFA, *PSTYLEBUFA, NEAR *NPSTYLEBUFA, FAR *LPSTYLEBUFA;
  86. typedef struct tagSTYLEBUFW {
  87. DWORD dwStyle;
  88. WCHAR szDescription[STYLE_DESCRIPTION_SIZE];
  89. } STYLEBUFW, *PSTYLEBUFW, NEAR *NPSTYLEBUFW, FAR *LPSTYLEBUFW;
  90. #ifdef UNICODE
  91. typedef STYLEBUFW STYLEBUF;
  92. typedef PSTYLEBUFW PSTYLEBUF;
  93. typedef NPSTYLEBUFW NPSTYLEBUF;
  94. typedef LPSTYLEBUFW LPSTYLEBUF;
  95. #else
  96. typedef STYLEBUFA STYLEBUF;
  97. typedef PSTYLEBUFA PSTYLEBUF;
  98. typedef NPSTYLEBUFA NPSTYLEBUF;
  99. typedef LPSTYLEBUFA LPSTYLEBUF;
  100. #endif // UNICODE
  101. #if(IMM_WINVER >= 0x040A)
  102. #define IMEMENUITEM_STRING_SIZE 80
  103. typedef struct tagIMEMENUITEMINFOA {
  104. UINT cbSize;
  105. UINT fType;
  106. UINT fState;
  107. UINT wID;
  108. HBITMAP hbmpChecked;
  109. HBITMAP hbmpUnchecked;
  110. DWORD dwItemData;
  111. CHAR szString[IMEMENUITEM_STRING_SIZE];
  112. HBITMAP hbmpItem;
  113. } IMEMENUITEMINFOA, *PIMEMENUITEMINFOA, NEAR *NPIMEMENUITEMINFOA, FAR *LPIMEMENUITEMINFOA;
  114. typedef struct tagIMEMENUITEMINFOW {
  115. UINT cbSize;
  116. UINT fType;
  117. UINT fState;
  118. UINT wID;
  119. HBITMAP hbmpChecked;
  120. HBITMAP hbmpUnchecked;
  121. DWORD dwItemData;
  122. WCHAR szString[IMEMENUITEM_STRING_SIZE];
  123. HBITMAP hbmpItem;
  124. } IMEMENUITEMINFOW, *PIMEMENUITEMINFOW, NEAR *NPIMEMENUITEMINFOW, FAR *LPIMEMENUITEMINFOW;
  125. #ifdef UNICODE
  126. typedef IMEMENUITEMINFOW IMEMENUITEMINFO;
  127. typedef PIMEMENUITEMINFOW PIMEMENUITEMINFO;
  128. typedef NPIMEMENUITEMINFOW NPIMEMENUITEMINFO;
  129. typedef LPIMEMENUITEMINFOW LPIMEMENUITEMINFO;
  130. #else
  131. typedef IMEMENUITEMINFOA IMEMENUITEMINFO;
  132. typedef PIMEMENUITEMINFOA PIMEMENUITEMINFO;
  133. typedef NPIMEMENUITEMINFOA NPIMEMENUITEMINFO;
  134. typedef LPIMEMENUITEMINFOA LPIMEMENUITEMINFO;
  135. #endif // UNICODE
  136. typedef struct tagIMECHARPOSITION {
  137. DWORD dwSize;
  138. DWORD dwCharPos;
  139. POINT pt;
  140. UINT cLineHeight;
  141. RECT rcDocument;
  142. } IMECHARPOSITION, *PIMECHARPOSITION, NEAR *NPIMECHARPOSITION, FAR *LPIMECHARPOSITION;
  143. #endif /* IMM_WINVER >= 0x040A */
  144. // prototype of IMM API
  145. HKL WINAPI ImmInstallIMEA(LPCSTR lpszIMEFileName, LPCSTR lpszLayoutText);
  146. HKL WINAPI ImmInstallIMEW(LPCWSTR lpszIMEFileName, LPCWSTR lpszLayoutText);
  147. #ifdef UNICODE
  148. #define ImmInstallIME ImmInstallIMEW
  149. #else
  150. #define ImmInstallIME ImmInstallIMEA
  151. #endif // !UNICODE
  152. HWND WINAPI ImmGetDefaultIMEWnd(HWND);
  153. UINT WINAPI ImmGetDescriptionA(HKL, LPSTR, UINT uBufLen);
  154. UINT WINAPI ImmGetDescriptionW(HKL, LPWSTR, UINT uBufLen);
  155. #ifdef UNICODE
  156. #define ImmGetDescription ImmGetDescriptionW
  157. #else
  158. #define ImmGetDescription ImmGetDescriptionA
  159. #endif // !UNICODE
  160. UINT WINAPI ImmGetIMEFileNameA(HKL, LPSTR, UINT uBufLen);
  161. UINT WINAPI ImmGetIMEFileNameW(HKL, LPWSTR, UINT uBufLen);
  162. #ifdef UNICODE
  163. #define ImmGetIMEFileName ImmGetIMEFileNameW
  164. #else
  165. #define ImmGetIMEFileName ImmGetIMEFileNameA
  166. #endif // !UNICODE
  167. DWORD WINAPI ImmGetProperty(HKL, DWORD);
  168. BOOL WINAPI ImmIsIME(HKL);
  169. BOOL WINAPI ImmSimulateHotKey(HWND, DWORD);
  170. HIMC WINAPI ImmCreateContext(void);
  171. BOOL WINAPI ImmDestroyContext(HIMC);
  172. HIMC WINAPI ImmGetContext(HWND);
  173. BOOL WINAPI ImmReleaseContext(HWND, HIMC);
  174. HIMC WINAPI ImmAssociateContext(HWND, HIMC);
  175. #if(IMM_WINVER >= 0x040A)
  176. BOOL WINAPI ImmAssociateContextEx(HWND, HIMC, DWORD);
  177. #endif /* IMM_WINVER >= 0x040A */
  178. LONG WINAPI ImmGetCompositionStringA(HIMC, DWORD, LPVOID, DWORD);
  179. LONG WINAPI ImmGetCompositionStringW(HIMC, DWORD, LPVOID, DWORD);
  180. #ifdef UNICODE
  181. #define ImmGetCompositionString ImmGetCompositionStringW
  182. #else
  183. #define ImmGetCompositionString ImmGetCompositionStringA
  184. #endif // !UNICODE
  185. BOOL WINAPI ImmSetCompositionStringA(HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD);
  186. BOOL WINAPI ImmSetCompositionStringW(HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD);
  187. #ifdef UNICODE
  188. #define ImmSetCompositionString ImmSetCompositionStringW
  189. #else
  190. #define ImmSetCompositionString ImmSetCompositionStringA
  191. #endif // !UNICODE
  192. DWORD WINAPI ImmGetCandidateListCountA(HIMC, LPDWORD);
  193. DWORD WINAPI ImmGetCandidateListCountW(HIMC, LPDWORD);
  194. #ifdef UNICODE
  195. #define ImmGetCandidateListCount ImmGetCandidateListCountW
  196. #else
  197. #define ImmGetCandidateListCount ImmGetCandidateListCountA
  198. #endif // !UNICODE
  199. DWORD WINAPI ImmGetCandidateListA(HIMC, DWORD, LPCANDIDATELIST, DWORD);
  200. DWORD WINAPI ImmGetCandidateListW(HIMC, DWORD, LPCANDIDATELIST, DWORD);
  201. #ifdef UNICODE
  202. #define ImmGetCandidateList ImmGetCandidateListW
  203. #else
  204. #define ImmGetCandidateList ImmGetCandidateListA
  205. #endif // !UNICODE
  206. DWORD WINAPI ImmGetGuideLineA(HIMC, DWORD, LPSTR, DWORD);
  207. DWORD WINAPI ImmGetGuideLineW(HIMC, DWORD, LPWSTR, DWORD);
  208. #ifdef UNICODE
  209. #define ImmGetGuideLine ImmGetGuideLineW
  210. #else
  211. #define ImmGetGuideLine ImmGetGuideLineA
  212. #endif // !UNICODE
  213. BOOL WINAPI ImmGetConversionStatus(HIMC, LPDWORD, LPDWORD);
  214. BOOL WINAPI ImmSetConversionStatus(HIMC, DWORD, DWORD);
  215. BOOL WINAPI ImmGetOpenStatus(HIMC);
  216. BOOL WINAPI ImmSetOpenStatus(HIMC, BOOL);
  217. BOOL WINAPI ImmGetCompositionFontA(HIMC, LPLOGFONTA);
  218. BOOL WINAPI ImmGetCompositionFontW(HIMC, LPLOGFONTW);
  219. #ifdef UNICODE
  220. #define ImmGetCompositionFont ImmGetCompositionFontW
  221. #else
  222. #define ImmGetCompositionFont ImmGetCompositionFontA
  223. #endif // !UNICODE
  224. BOOL WINAPI ImmSetCompositionFontA(HIMC, LPLOGFONTA);
  225. BOOL WINAPI ImmSetCompositionFontW(HIMC, LPLOGFONTW);
  226. #ifdef UNICODE
  227. #define ImmSetCompositionFont ImmSetCompositionFontW
  228. #else
  229. #define ImmSetCompositionFont ImmSetCompositionFontA
  230. #endif // !UNICODE
  231. BOOL WINAPI ImmConfigureIMEA(HKL, HWND, DWORD, LPVOID);
  232. BOOL WINAPI ImmConfigureIMEW(HKL, HWND, DWORD, LPVOID);
  233. #ifdef UNICODE
  234. #define ImmConfigureIME ImmConfigureIMEW
  235. #else
  236. #define ImmConfigureIME ImmConfigureIMEA
  237. #endif // !UNICODE
  238. LRESULT WINAPI ImmEscapeA(HKL, HIMC, UINT, LPVOID);
  239. LRESULT WINAPI ImmEscapeW(HKL, HIMC, UINT, LPVOID);
  240. #if 0
  241. #ifdef UNICODE
  242. #define ImmEscape ImmEscapeW
  243. #else
  244. #define ImmEscape ImmEscapeA
  245. #endif // !UNICODE
  246. #endif
  247. DWORD WINAPI ImmGetConversionListA(HKL, HIMC, LPCSTR, LPCANDIDATELIST, DWORD, UINT);
  248. DWORD WINAPI ImmGetConversionListW(HKL, HIMC, LPCWSTR, LPCANDIDATELIST, DWORD, UINT);
  249. #ifdef UNICODE
  250. #define ImmGetConversionList ImmGetConversionListW
  251. #else
  252. #define ImmGetConversionList ImmGetConversionListA
  253. #endif // !UNICODE
  254. BOOL WINAPI ImmNotifyIME(HIMC, DWORD, DWORD, DWORD);
  255. BOOL WINAPI ImmGetStatusWindowPos(HIMC, LPPOINT);
  256. BOOL WINAPI ImmSetStatusWindowPos(HIMC, LPPOINT);
  257. BOOL WINAPI ImmGetCompositionWindow(HIMC, LPCOMPOSITIONFORM);
  258. BOOL WINAPI ImmSetCompositionWindow(HIMC, LPCOMPOSITIONFORM);
  259. BOOL WINAPI ImmGetCandidateWindow(HIMC, DWORD, LPCANDIDATEFORM);
  260. BOOL WINAPI ImmSetCandidateWindow(HIMC, LPCANDIDATEFORM);
  261. BOOL WINAPI ImmIsUIMessageA(HWND, UINT, WPARAM, LPARAM);
  262. BOOL WINAPI ImmIsUIMessageW(HWND, UINT, WPARAM, LPARAM);
  263. #ifdef UNICODE
  264. #define ImmIsUIMessage ImmIsUIMessageW
  265. #else
  266. #define ImmIsUIMessage ImmIsUIMessageA
  267. #endif // !UNICODE
  268. UINT WINAPI ImmGetVirtualKey(HWND);
  269. typedef int (CALLBACK *REGISTERWORDENUMPROCA)(LPCSTR, DWORD, LPCSTR, LPVOID);
  270. typedef int (CALLBACK *REGISTERWORDENUMPROCW)(LPCWSTR, DWORD, LPCWSTR, LPVOID);
  271. #ifdef UNICODE
  272. #define REGISTERWORDENUMPROC REGISTERWORDENUMPROCW
  273. #else
  274. #define REGISTERWORDENUMPROC REGISTERWORDENUMPROCA
  275. #endif // !UNICODE
  276. BOOL WINAPI ImmRegisterWordA(HKL, LPCSTR, DWORD, LPCSTR);
  277. BOOL WINAPI ImmRegisterWordW(HKL, LPCWSTR, DWORD, LPCWSTR);
  278. #ifdef UNICODE
  279. #define ImmRegisterWord ImmRegisterWordW
  280. #else
  281. #define ImmRegisterWord ImmRegisterWordA
  282. #endif // !UNICODE
  283. BOOL WINAPI ImmUnregisterWordA(HKL, LPCSTR, DWORD, LPCSTR);
  284. BOOL WINAPI ImmUnregisterWordW(HKL, LPCWSTR, DWORD, LPCWSTR);
  285. #ifdef UNICODE
  286. #define ImmUnregisterWord ImmUnregisterWordW
  287. #else
  288. #define ImmUnregisterWord ImmUnregisterWordA
  289. #endif // !UNICODE
  290. UINT WINAPI ImmGetRegisterWordStyleA(HKL, UINT, LPSTYLEBUFA);
  291. UINT WINAPI ImmGetRegisterWordStyleW(HKL, UINT, LPSTYLEBUFW);
  292. #ifdef UNICODE
  293. #define ImmGetRegisterWordStyle ImmGetRegisterWordStyleW
  294. #else
  295. #define ImmGetRegisterWordStyle ImmGetRegisterWordStyleA
  296. #endif // !UNICODE
  297. UINT WINAPI ImmEnumRegisterWordA(HKL, REGISTERWORDENUMPROCA, LPCSTR, DWORD, LPCSTR, LPVOID);
  298. UINT WINAPI ImmEnumRegisterWordW(HKL, REGISTERWORDENUMPROCW, LPCWSTR, DWORD, LPCWSTR, LPVOID);
  299. #ifdef UNICODE
  300. #define ImmEnumRegisterWord ImmEnumRegisterWordW
  301. #else
  302. #define ImmEnumRegisterWord ImmEnumRegisterWordA
  303. #endif // !UNICODE
  304. #if(IMM_WINVER >= 0x040A)
  305. BOOL WINAPI ImmDisableIME(DWORD);
  306. DWORD WINAPI ImmGetImeMenuItemsA(HIMC, DWORD, DWORD, LPIMEMENUITEMINFOA, LPIMEMENUITEMINFOA, DWORD);
  307. DWORD WINAPI ImmGetImeMenuItemsW(HIMC, DWORD, DWORD, LPIMEMENUITEMINFOW, LPIMEMENUITEMINFOW, DWORD);
  308. #ifdef UNICODE
  309. #define ImmGetImeMenuItems ImmGetImeMenuItemsW
  310. #else
  311. #define ImmGetImeMenuItems ImmGetImeMenuItemsA
  312. #endif // !UNICODE
  313. #ifdef UNICODE
  314. #define ImmRequestMessage ImmRequestMessageW
  315. #else
  316. #define ImmRequestMessage ImmRequestMessageA
  317. #endif // !UNICODE
  318. #endif /* IMM_WINVER >= 0x040A */
  319. // the IME related messages
  320. #define WM_CONVERTREQUESTEX 0x0108
  321. #define WM_IME_STARTCOMPOSITION 0x010D
  322. #define WM_IME_ENDCOMPOSITION 0x010E
  323. #define WM_IME_COMPOSITION 0x010F
  324. #define WM_IME_KEYLAST 0x010F
  325. #define WM_IME_SETCONTEXT 0x0281
  326. #define WM_IME_NOTIFY 0x0282
  327. #define WM_IME_CONTROL 0x0283
  328. #define WM_IME_COMPOSITIONFULL 0x0284
  329. #define WM_IME_SELECT 0x0285
  330. #define WM_IME_CHAR 0x0286
  331. #define WM_IME_REQUEST 0x0288
  332. #define WM_IME_KEYDOWN 0x0290
  333. #define WM_IME_KEYUP 0x0291
  334. // wParam for WM_IME_CONTROL
  335. #define IMC_GETCANDIDATEPOS 0x0007
  336. #define IMC_SETCANDIDATEPOS 0x0008
  337. #define IMC_GETCOMPOSITIONFONT 0x0009
  338. #define IMC_SETCOMPOSITIONFONT 0x000A
  339. #define IMC_GETCOMPOSITIONWINDOW 0x000B
  340. #define IMC_SETCOMPOSITIONWINDOW 0x000C
  341. #define IMC_GETSTATUSWINDOWPOS 0x000F
  342. #define IMC_SETSTATUSWINDOWPOS 0x0010
  343. #define IMC_CLOSESTATUSWINDOW 0x0021
  344. #define IMC_OPENSTATUSWINDOW 0x0022
  345. // wParam for WM_IME_CONTROL to the soft keyboard
  346. // dwAction for ImmNotifyIME
  347. #define NI_OPENCANDIDATE 0x0010
  348. #define NI_CLOSECANDIDATE 0x0011
  349. #define NI_SELECTCANDIDATESTR 0x0012
  350. #define NI_CHANGECANDIDATELIST 0x0013
  351. #define NI_FINALIZECONVERSIONRESULT 0x0014
  352. #define NI_COMPOSITIONSTR 0x0015
  353. #define NI_SETCANDIDATE_PAGESTART 0x0016
  354. #define NI_SETCANDIDATE_PAGESIZE 0x0017
  355. #define NI_IMEMENUSELECTED 0x0018
  356. // lParam for WM_IME_SETCONTEXT
  357. #define ISC_SHOWUICANDIDATEWINDOW 0x00000001
  358. #define ISC_SHOWUICOMPOSITIONWINDOW 0x80000000
  359. #define ISC_SHOWUIGUIDELINE 0x40000000
  360. #define ISC_SHOWUIALLCANDIDATEWINDOW 0x0000000F
  361. #define ISC_SHOWUIALL 0xC000000F
  362. // dwIndex for ImmNotifyIME/NI_COMPOSITIONSTR
  363. #define CPS_COMPLETE 0x0001
  364. #define CPS_CONVERT 0x0002
  365. #define CPS_REVERT 0x0003
  366. #define CPS_CANCEL 0x0004
  367. // the modifiers of hot key
  368. #define MOD_ALT 0x0001
  369. #define MOD_CONTROL 0x0002
  370. #define MOD_SHIFT 0x0004
  371. #define MOD_LEFT 0x8000
  372. #define MOD_RIGHT 0x4000
  373. #define MOD_ON_KEYUP 0x0800
  374. #define MOD_IGNORE_ALL_MODIFIER 0x0400
  375. // Windows for Simplified Chinese Edition hot key ID from 0x10 - 0x2F
  376. #define IME_CHOTKEY_IME_NONIME_TOGGLE 0x10
  377. #define IME_CHOTKEY_SHAPE_TOGGLE 0x11
  378. #define IME_CHOTKEY_SYMBOL_TOGGLE 0x12
  379. // Windows for Japanese Edition hot key ID from 0x30 - 0x4F
  380. #define IME_JHOTKEY_CLOSE_OPEN 0x30
  381. // Windows for Korean Edition hot key ID from 0x50 - 0x6F
  382. #define IME_KHOTKEY_SHAPE_TOGGLE 0x50
  383. #define IME_KHOTKEY_HANJACONVERT 0x51
  384. #define IME_KHOTKEY_ENGLISH 0x52
  385. // Windows for Tranditional Chinese Edition hot key ID from 0x70 - 0x8F
  386. #define IME_THOTKEY_IME_NONIME_TOGGLE 0x70
  387. #define IME_THOTKEY_SHAPE_TOGGLE 0x71
  388. #define IME_THOTKEY_SYMBOL_TOGGLE 0x72
  389. // direct switch hot key ID from 0x100 - 0x11F
  390. #define IME_HOTKEY_DSWITCH_FIRST 0x100
  391. #define IME_HOTKEY_DSWITCH_LAST 0x11F
  392. // IME private hot key from 0x200 - 0x21F
  393. #define IME_HOTKEY_PRIVATE_FIRST 0x200
  394. #define IME_ITHOTKEY_RESEND_RESULTSTR 0x200
  395. #define IME_ITHOTKEY_PREVIOUS_COMPOSITION 0x201
  396. #define IME_ITHOTKEY_UISTYLE_TOGGLE 0x202
  397. #define IME_ITHOTKEY_RECONVERTSTRING 0x203
  398. #define IME_HOTKEY_PRIVATE_LAST 0x21F
  399. // dwSystemInfoFlags bits
  400. // parameter of ImmGetCompositionString
  401. #define GCS_COMPREADSTR 0x0001
  402. #define GCS_COMPREADATTR 0x0002
  403. #define GCS_COMPREADCLAUSE 0x0004
  404. #define GCS_COMPSTR 0x0008
  405. #define GCS_COMPATTR 0x0010
  406. #define GCS_COMPCLAUSE 0x0020
  407. #define GCS_CURSORPOS 0x0080
  408. #define GCS_DELTASTART 0x0100
  409. #define GCS_RESULTREADSTR 0x0200
  410. #define GCS_RESULTREADCLAUSE 0x0400
  411. #define GCS_RESULTSTR 0x0800
  412. #define GCS_RESULTCLAUSE 0x1000
  413. // style bit flags for WM_IME_COMPOSITION
  414. #define CS_INSERTCHAR 0x2000
  415. #define CS_NOMOVECARET 0x4000
  416. // bits of fdwInit of INPUTCONTEXT
  417. // IME version constants
  418. #define IMEVER_0310 0x0003000A
  419. #define IMEVER_0400 0x00040000
  420. // IME property bits
  421. #define IME_PROP_AT_CARET 0x00010000
  422. #define IME_PROP_SPECIAL_UI 0x00020000
  423. #define IME_PROP_CANDLIST_START_FROM_1 0x00040000
  424. #define IME_PROP_UNICODE 0x00080000
  425. #define IME_PROP_COMPLETE_ON_UNSELECT 0x00100000
  426. // IME UICapability bits
  427. #define UI_CAP_2700 0x00000001
  428. #define UI_CAP_ROT90 0x00000002
  429. #define UI_CAP_ROTANY 0x00000004
  430. // ImmSetCompositionString Capability bits
  431. #define SCS_CAP_COMPSTR 0x00000001
  432. #define SCS_CAP_MAKEREAD 0x00000002
  433. #define SCS_CAP_SETRECONVERTSTRING 0x00000004
  434. // IME WM_IME_SELECT inheritance Capability bits
  435. #define SELECT_CAP_CONVERSION 0x00000001
  436. #define SELECT_CAP_SENTENCE 0x00000002
  437. // ID for deIndex of ImmGetGuideLine
  438. #define GGL_LEVEL 0x00000001
  439. #define GGL_INDEX 0x00000002
  440. #define GGL_STRING 0x00000003
  441. #define GGL_PRIVATE 0x00000004
  442. // ID for dwLevel of GUIDELINE Structure
  443. #define GL_LEVEL_NOGUIDELINE 0x00000000
  444. #define GL_LEVEL_FATAL 0x00000001
  445. #define GL_LEVEL_ERROR 0x00000002
  446. #define GL_LEVEL_WARNING 0x00000003
  447. #define GL_LEVEL_INFORMATION 0x00000004
  448. // ID for dwIndex of GUIDELINE Structure
  449. #define GL_ID_UNKNOWN 0x00000000
  450. #define GL_ID_NOMODULE 0x00000001
  451. #define GL_ID_NODICTIONARY 0x00000010
  452. #define GL_ID_CANNOTSAVE 0x00000011
  453. #define GL_ID_NOCONVERT 0x00000020
  454. #define GL_ID_TYPINGERROR 0x00000021
  455. #define GL_ID_TOOMANYSTROKE 0x00000022
  456. #define GL_ID_READINGCONFLICT 0x00000023
  457. #define GL_ID_INPUTREADING 0x00000024
  458. #define GL_ID_INPUTRADICAL 0x00000025
  459. #define GL_ID_INPUTCODE 0x00000026
  460. #define GL_ID_INPUTSYMBOL 0x00000027
  461. #define GL_ID_CHOOSECANDIDATE 0x00000028
  462. #define GL_ID_REVERSECONVERSION 0x00000029
  463. #define GL_ID_PRIVATE_FIRST 0x00008000
  464. #define GL_ID_PRIVATE_LAST 0x0000FFFF
  465. // ID for dwIndex of ImmGetProperty
  466. #define IGP_GETIMEVERSION (DWORD)(-4)
  467. #define IGP_PROPERTY 0x00000004
  468. #define IGP_CONVERSION 0x00000008
  469. #define IGP_SENTENCE 0x0000000c
  470. #define IGP_UI 0x00000010
  471. #define IGP_SETCOMPSTR 0x00000014
  472. #define IGP_SELECT 0x00000018
  473. // dwIndex for ImmSetCompositionString API
  474. #define SCS_SETSTR (GCS_COMPREADSTR|GCS_COMPSTR)
  475. #define SCS_CHANGEATTR (GCS_COMPREADATTR|GCS_COMPATTR)
  476. #define SCS_CHANGECLAUSE (GCS_COMPREADCLAUSE|GCS_COMPCLAUSE)
  477. #define SCS_SETRECONVERTSTRING 0x00010000
  478. #define SCS_QUERYRECONVERTSTRING 0x00020000
  479. // attribute for COMPOSITIONSTRING Structure
  480. #define ATTR_INPUT 0x00
  481. #define ATTR_TARGET_CONVERTED 0x01
  482. #define ATTR_CONVERTED 0x02
  483. #define ATTR_TARGET_NOTCONVERTED 0x03
  484. #define ATTR_INPUT_ERROR 0x04
  485. #define ATTR_FIXEDCONVERTED 0x05
  486. // bit field for IMC_SETCOMPOSITIONWINDOW, IMC_SETCANDIDATEWINDOW
  487. #define CFS_DEFAULT 0x0000
  488. #define CFS_RECT 0x0001
  489. #define CFS_POINT 0x0002
  490. #define CFS_FORCE_POSITION 0x0020
  491. #define CFS_CANDIDATEPOS 0x0040
  492. #define CFS_EXCLUDE 0x0080
  493. // conversion direction for ImmGetConversionList
  494. #define GCL_CONVERSION 0x0001
  495. #define GCL_REVERSECONVERSION 0x0002
  496. #define GCL_REVERSE_LENGTH 0x0003
  497. // bit field for conversion mode
  498. #define IME_CMODE_ALPHANUMERIC 0x0000
  499. #define IME_CMODE_NATIVE 0x0001
  500. #define IME_CMODE_CHINESE IME_CMODE_NATIVE
  501. #define IME_CMODE_HANGEUL IME_CMODE_NATIVE
  502. #define IME_CMODE_JAPANESE IME_CMODE_NATIVE
  503. #define IME_CMODE_KATAKANA 0x0002 // only effect under IME_CMODE_NATIVE
  504. #define IME_CMODE_LANGUAGE 0x0003
  505. #define IME_CMODE_FULLSHAPE 0x0008
  506. #define IME_CMODE_ROMAN 0x0010
  507. #define IME_CMODE_CHARCODE 0x0020
  508. #define IME_CMODE_HANJACONVERT 0x0040
  509. #define IME_CMODE_SOFTKBD 0x0080
  510. #define IME_CMODE_NOCONVERSION 0x0100
  511. #define IME_CMODE_EUDC 0x0200
  512. #define IME_CMODE_SYMBOL 0x0400
  513. #define IME_CMODE_FIXED 0x0800
  514. #define IME_SMODE_NONE 0x0000
  515. #define IME_SMODE_PLAURALCLAUSE 0x0001
  516. #define IME_SMODE_SINGLECONVERT 0x0002
  517. #define IME_SMODE_AUTOMATIC 0x0004
  518. #define IME_SMODE_PHRASEPREDICT 0x0008
  519. #define IME_SMODE_CONVERSATION 0x0010
  520. // style of candidate
  521. #define IME_CAND_UNKNOWN 0x0000
  522. #define IME_CAND_READ 0x0001
  523. #define IME_CAND_CODE 0x0002
  524. #define IME_CAND_MEANING 0x0003
  525. #define IME_CAND_RADICAL 0x0004
  526. #define IME_CAND_STROKE 0x0005
  527. // wParam of report message WM_IME_NOTIFY
  528. #define IMN_CLOSESTATUSWINDOW 0x0001
  529. #define IMN_OPENSTATUSWINDOW 0x0002
  530. #define IMN_CHANGECANDIDATE 0x0003
  531. #define IMN_CLOSECANDIDATE 0x0004
  532. #define IMN_OPENCANDIDATE 0x0005
  533. #define IMN_SETCONVERSIONMODE 0x0006
  534. #define IMN_SETSENTENCEMODE 0x0007
  535. #define IMN_SETOPENSTATUS 0x0008
  536. #define IMN_SETCANDIDATEPOS 0x0009
  537. #define IMN_SETCOMPOSITIONFONT 0x000A
  538. #define IMN_SETCOMPOSITIONWINDOW 0x000B
  539. #define IMN_SETSTATUSWINDOWPOS 0x000C
  540. #define IMN_GUIDELINE 0x000D
  541. #define IMN_PRIVATE 0x000E
  542. #if(IMM_WINVER >= 0x040A)
  543. // wParam of report message WM_IME_REQUEST
  544. #define IMR_COMPOSITIONWINDOW 0x0001
  545. #define IMR_CANDIDATEWINDOW 0x0002
  546. #define IMR_COMPOSITIONFONT 0x0003
  547. #define IMR_RECONVERTSTRING 0x0004
  548. #define IMR_CONFIRMRECONVERTSTRING 0x0005
  549. #define IMR_QUERYCHARPOSITION 0x0006
  550. #define IMR_DOCUMENTFEED 0x0007
  551. #endif
  552. // error code of ImmGetCompositionString
  553. #define IMM_ERROR_NODATA (-1)
  554. #define IMM_ERROR_GENERAL (-2)
  555. // dialog mode of ImmConfigureIME
  556. #define IME_CONFIG_GENERAL 1
  557. #define IME_CONFIG_REGISTERWORD 2
  558. #define IME_CONFIG_SELECTDICTIONARY 3
  559. // dialog mode of ImmEscape
  560. #define IME_ESC_QUERY_SUPPORT 0x0003
  561. #define IME_ESC_RESERVED_FIRST 0x0004
  562. #define IME_ESC_RESERVED_LAST 0x07FF
  563. #define IME_ESC_PRIVATE_FIRST 0x0800
  564. #define IME_ESC_PRIVATE_LAST 0x0FFF
  565. #define IME_ESC_SEQUENCE_TO_INTERNAL 0x1001
  566. #define IME_ESC_GET_EUDC_DICTIONARY 0x1003
  567. #define IME_ESC_SET_EUDC_DICTIONARY 0x1004
  568. #define IME_ESC_MAX_KEY 0x1005
  569. #define IME_ESC_IME_NAME 0x1006
  570. #define IME_ESC_SYNC_HOTKEY 0x1007
  571. #define IME_ESC_HANJA_MODE 0x1008
  572. #define IME_ESC_AUTOMATA 0x1009
  573. #define IME_ESC_PRIVATE_HOTKEY 0x100a
  574. #define IME_ESC_GETHELPFILENAME 0x100b
  575. // style of word registration
  576. #define IME_REGWORD_STYLE_EUDC 0x00000001
  577. #define IME_REGWORD_STYLE_USER_FIRST 0x80000000
  578. #define IME_REGWORD_STYLE_USER_LAST 0xFFFFFFFF
  579. #if(IMM_WINVER >= 0x040A)
  580. // dwFlags for ImmAssociateContextEx
  581. #define IACE_CHILDREN 0x0001
  582. #define IACE_DEFAULT 0x0010
  583. #define IACE_IGNORENOCONTEXT 0x0020
  584. // dwFlags for ImmGetImeMenuItems
  585. #define IGIMIF_RIGHTMENU 0x00000001
  586. // dwType for ImmGetImeMenuItems
  587. #define IGIMII_CMODE 0x00000001
  588. #define IGIMII_SMODE 0x00000002
  589. #define IGIMII_CONFIGURE 0x00000004
  590. #define IGIMII_TOOLS 0x00000008
  591. #define IGIMII_HELP 0x00000010
  592. #define IGIMII_OTHER 0x00000020
  593. #define IGIMII_INPUTTOOLS 0x00000040
  594. // fType of IMEMENUITEMINFO structure
  595. #define IMFT_RADIOCHECK 0x00001
  596. #define IMFT_SEPARATOR 0x00002
  597. #define IMFT_SUBMENU 0x00004
  598. // fState of IMEMENUITEMINFO structure
  599. #define IMFS_GRAYED MFS_GRAYED
  600. #define IMFS_DISABLED MFS_DISABLED
  601. #define IMFS_CHECKED MFS_CHECKED
  602. #define IMFS_HILITE MFS_HILITE
  603. #define IMFS_ENABLED MFS_ENABLED
  604. #define IMFS_UNCHECKED MFS_UNCHECKED
  605. #define IMFS_UNHILITE MFS_UNHILITE
  606. #define IMFS_DEFAULT MFS_DEFAULT
  607. #endif /* IMM_WINVER >= 0x040A */
  608. // type of soft keyboard
  609. // for Windows Tranditional Chinese Edition
  610. #define SOFTKEYBOARD_TYPE_T1 0x0001
  611. // for Windows Simplified Chinese Edition
  612. #define SOFTKEYBOARD_TYPE_C1 0x0002
  613. #ifdef __cplusplus
  614. }
  615. #endif
  616. #endif // _IMM_