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.

718 lines
26 KiB

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