Windows NT 4.0 source code leak
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.

760 lines
30 KiB

4 years ago
  1. /**********************************************************************/
  2. /* IMM.H - Input Method Manager definitions */
  3. /* */
  4. /* Copyright (c) 1993-1996 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. typedef DWORD HIMC;
  12. typedef DWORD HIMCC;
  13. typedef HKL FAR *LPHKL;
  14. typedef UINT FAR *LPUINT;
  15. typedef struct tagCOMPOSITIONFORM {
  16. DWORD dwStyle;
  17. POINT ptCurrentPos;
  18. RECT rcArea;
  19. } COMPOSITIONFORM, *PCOMPOSITIONFORM, NEAR *NPCOMPOSITIONFORM, FAR *LPCOMPOSITIONFORM;
  20. typedef struct tagCANDIDATEFORM {
  21. DWORD dwIndex;
  22. DWORD dwStyle;
  23. POINT ptCurrentPos;
  24. RECT rcArea;
  25. } CANDIDATEFORM, *PCANDIDATEFORM, NEAR *NPCANDIDATEFORM, FAR *LPCANDIDATEFORM;
  26. typedef struct tagCOMPOSITIONSTRING { //
  27. DWORD dwSize; //
  28. DWORD dwCompReadAttrLen; //
  29. DWORD dwCompReadAttrOffset; //
  30. DWORD dwCompReadClauseLen; //
  31. DWORD dwCompReadClauseOffset; //
  32. DWORD dwCompReadStrLen; //
  33. DWORD dwCompReadStrOffset; //
  34. DWORD dwCompAttrLen; //
  35. DWORD dwCompAttrOffset; //
  36. DWORD dwCompClauseLen; //
  37. DWORD dwCompClauseOffset; //
  38. DWORD dwCompStrLen; //
  39. DWORD dwCompStrOffset; //
  40. DWORD dwCursorPos; //
  41. DWORD dwDeltaStart; //
  42. DWORD dwResultReadClauseLen; //
  43. DWORD dwResultReadClauseOffset; //
  44. DWORD dwResultReadStrLen; //
  45. DWORD dwResultReadStrOffset; //
  46. DWORD dwResultClauseLen; //
  47. DWORD dwResultClauseOffset; //
  48. DWORD dwResultStrLen; //
  49. DWORD dwResultStrOffset; //
  50. DWORD dwPrivateSize; //
  51. DWORD dwPrivateOffset; //
  52. } COMPOSITIONSTRING, *PCOMPOSITIONSTRING, NEAR *NPCOMPOSITIONSTRING, FAR *LPCOMPOSITIONSTRING; //
  53. //
  54. //
  55. typedef struct tagGUIDELINE { //
  56. DWORD dwSize; //
  57. DWORD dwLevel; //
  58. DWORD dwIndex; //
  59. DWORD dwStrLen; //
  60. DWORD dwStrOffset; //
  61. DWORD dwPrivateSize; //
  62. DWORD dwPrivateOffset; //
  63. } GUIDELINE, *PGUIDELINE, NEAR *NPGUIDELINE, FAR *LPGUIDELINE; //
  64. //
  65. //
  66. typedef struct tagCANDIDATELIST {
  67. DWORD dwSize;
  68. DWORD dwStyle;
  69. DWORD dwCount;
  70. DWORD dwSelection;
  71. DWORD dwPageStart;
  72. DWORD dwPageSize;
  73. DWORD dwOffset[1];
  74. } CANDIDATELIST, *PCANDIDATELIST, NEAR *NPCANDIDATELIST, FAR *LPCANDIDATELIST;
  75. typedef struct tagREGISTERWORDA {
  76. LPSTR lpReading;
  77. LPSTR lpWord;
  78. } REGISTERWORDA, *PREGISTERWORDA, NEAR *NPREGISTERWORDA, FAR *LPREGISTERWORDA;
  79. typedef struct tagREGISTERWORDW {
  80. LPWSTR lpReading;
  81. LPWSTR lpWord;
  82. } REGISTERWORDW, *PREGISTERWORDW, NEAR *NPREGISTERWORDW, FAR *LPREGISTERWORDW;
  83. #ifdef UNICODE
  84. typedef REGISTERWORDW REGISTERWORD;
  85. typedef PREGISTERWORDW PREGISTERWORD;
  86. typedef NPREGISTERWORDW NPREGISTERWORD;
  87. typedef LPREGISTERWORDW LPREGISTERWORD;
  88. #else
  89. typedef REGISTERWORDA REGISTERWORD;
  90. typedef PREGISTERWORDA PREGISTERWORD;
  91. typedef NPREGISTERWORDA NPREGISTERWORD;
  92. typedef LPREGISTERWORDA LPREGISTERWORD;
  93. #endif // UNICODE
  94. typedef struct tagCANDIDATEINFO { //
  95. DWORD dwSize; //
  96. DWORD dwCount; //
  97. DWORD dwOffset[32]; //
  98. DWORD dwPrivateSize; //
  99. DWORD dwPrivateOffset; //
  100. } CANDIDATEINFO, *PCANDIDATEINFO, NEAR *NPCANDIDATEINFO, FAR *LPCANDIDATEINFO; //
  101. //
  102. //
  103. typedef struct tagINPUTCONTEXT { //
  104. HWND hWnd; //
  105. BOOL fOpen; //
  106. POINT ptStatusWndPos; //
  107. POINT ptSoftKbdPos; //
  108. DWORD fdwConversion; //
  109. DWORD fdwSentence; //
  110. union { //
  111. LOGFONTA A; //
  112. LOGFONTW W; //
  113. } lfFont; //
  114. COMPOSITIONFORM cfCompForm; //
  115. CANDIDATEFORM cfCandForm[4]; //
  116. HIMCC hCompStr; //
  117. HIMCC hCandInfo; //
  118. HIMCC hGuideLine; //
  119. HIMCC hPrivate; //
  120. DWORD dwNumMsgBuf; //
  121. HIMCC hMsgBuf; //
  122. DWORD fdwInit; //
  123. DWORD dwReserve[3]; //
  124. } INPUTCONTEXT, *PINPUTCONTEXT, NEAR *NPINPUTCONTEXT, FAR *LPINPUTCONTEXT; //
  125. //
  126. typedef struct tagIMEINFO { //
  127. DWORD dwPrivateDataSize; //
  128. DWORD fdwProperty; //
  129. DWORD fdwConversionCaps; //
  130. DWORD fdwSentenceCaps; //
  131. DWORD fdwUICaps; //
  132. DWORD fdwSCSCaps; //
  133. DWORD fdwSelectCaps; //
  134. } IMEINFO, *PIMEINFO, NEAR *NPIMEINFO, FAR *LPIMEINFO; //
  135. //
  136. //
  137. #define STYLE_DESCRIPTION_SIZE 32
  138. typedef struct tagSTYLEBUFA {
  139. DWORD dwStyle;
  140. CHAR szDescription[STYLE_DESCRIPTION_SIZE];
  141. } STYLEBUFA, *PSTYLEBUFA, NEAR *NPSTYLEBUFA, FAR *LPSTYLEBUFA;
  142. typedef struct tagSTYLEBUFW {
  143. DWORD dwStyle;
  144. WCHAR szDescription[STYLE_DESCRIPTION_SIZE];
  145. } STYLEBUFW, *PSTYLEBUFW, NEAR *NPSTYLEBUFW, FAR *LPSTYLEBUFW;
  146. #ifdef UNICODE
  147. typedef STYLEBUFW STYLEBUF;
  148. typedef PSTYLEBUFW PSTYLEBUF;
  149. typedef NPSTYLEBUFW NPSTYLEBUF;
  150. typedef LPSTYLEBUFW LPSTYLEBUF;
  151. #else
  152. typedef STYLEBUFA STYLEBUF;
  153. typedef PSTYLEBUFA PSTYLEBUF;
  154. typedef NPSTYLEBUFA NPSTYLEBUF;
  155. typedef LPSTYLEBUFA LPSTYLEBUF;
  156. #endif // UNICODE
  157. typedef struct tagSOFTKBDDATA { //
  158. UINT uCount; //
  159. WORD wCode[1][256]; //
  160. } SOFTKBDDATA, *PSOFTKBDDATA, NEAR *NPSOFTKBDDATA, FAR * LPSOFTKBDDATA; //
  161. //
  162. //
  163. // prototype of IMM API
  164. HKL WINAPI ImmInstallIMEA(LPCSTR lpszIMEFileName, LPCSTR lpszLayoutText);
  165. HKL WINAPI ImmInstallIMEW(LPCWSTR lpszIMEFileName, LPCWSTR lpszLayoutText);
  166. #ifdef UNICODE
  167. #define ImmInstallIME ImmInstallIMEW
  168. #else
  169. #define ImmInstallIME ImmInstallIMEA
  170. #endif // !UNICODE
  171. HWND WINAPI ImmGetDefaultIMEWnd(HWND);
  172. UINT WINAPI ImmGetDescriptionA(HKL, LPSTR, UINT uBufLen);
  173. UINT WINAPI ImmGetDescriptionW(HKL, LPWSTR, UINT uBufLen);
  174. #ifdef UNICODE
  175. #define ImmGetDescription ImmGetDescriptionW
  176. #else
  177. #define ImmGetDescription ImmGetDescriptionA
  178. #endif // !UNICODE
  179. UINT WINAPI ImmGetIMEFileNameA(HKL, LPSTR, UINT uBufLen);
  180. UINT WINAPI ImmGetIMEFileNameW(HKL, LPWSTR, UINT uBufLen);
  181. #ifdef UNICODE
  182. #define ImmGetIMEFileName ImmGetIMEFileNameW
  183. #else
  184. #define ImmGetIMEFileName ImmGetIMEFileNameA
  185. #endif // !UNICODE
  186. DWORD WINAPI ImmGetProperty(HKL, DWORD);
  187. BOOL WINAPI ImmIsIME(HKL);
  188. BOOL WINAPI ImmGetHotKey(DWORD, LPUINT lpuModifiers, LPUINT lpuVKey, LPHKL); //
  189. BOOL WINAPI ImmSetHotKey(DWORD, UINT, UINT, HKL); //
  190. BOOL WINAPI ImmSimulateHotKey(HWND, DWORD);
  191. HIMC WINAPI ImmCreateContext(void);
  192. BOOL WINAPI ImmDestroyContext(HIMC);
  193. HIMC WINAPI ImmGetContext(HWND);
  194. BOOL WINAPI ImmReleaseContext(HWND, HIMC);
  195. HIMC WINAPI ImmAssociateContext(HWND, HIMC);
  196. LONG WINAPI ImmGetCompositionStringA(HIMC, DWORD, LPVOID, DWORD);
  197. LONG WINAPI ImmGetCompositionStringW(HIMC, DWORD, LPVOID, DWORD);
  198. #ifdef UNICODE
  199. #define ImmGetCompositionString ImmGetCompositionStringW
  200. #else
  201. #define ImmGetCompositionString ImmGetCompositionStringA
  202. #endif // !UNICODE
  203. BOOL WINAPI ImmSetCompositionStringA(HIMC, DWORD dwIndex, LPCVOID lpComp, DWORD, LPCVOID lpRead, DWORD);
  204. BOOL WINAPI ImmSetCompositionStringW(HIMC, DWORD dwIndex, LPCVOID lpComp, DWORD, LPCVOID lpRead, DWORD);
  205. #ifdef UNICODE
  206. #define ImmSetCompositionString ImmSetCompositionStringW
  207. #else
  208. #define ImmSetCompositionString ImmSetCompositionStringA
  209. #endif // !UNICODE
  210. DWORD WINAPI ImmGetCandidateListCountA(HIMC, LPDWORD lpdwListCount);
  211. DWORD WINAPI ImmGetCandidateListCountW(HIMC, LPDWORD lpdwListCount);
  212. #ifdef UNICODE
  213. #define ImmGetCandidateListCount ImmGetCandidateListCountW
  214. #else
  215. #define ImmGetCandidateListCount ImmGetCandidateListCountA
  216. #endif // !UNICODE
  217. DWORD WINAPI ImmGetCandidateListA(HIMC, DWORD deIndex, LPCANDIDATELIST, DWORD dwBufLen);
  218. DWORD WINAPI ImmGetCandidateListW(HIMC, DWORD deIndex, LPCANDIDATELIST, DWORD dwBufLen);
  219. #ifdef UNICODE
  220. #define ImmGetCandidateList ImmGetCandidateListW
  221. #else
  222. #define ImmGetCandidateList ImmGetCandidateListA
  223. #endif // !UNICODE
  224. DWORD WINAPI ImmGetGuideLineA(HIMC, DWORD dwIndex, LPSTR, DWORD dwBufLen);
  225. DWORD WINAPI ImmGetGuideLineW(HIMC, DWORD dwIndex, LPWSTR, DWORD dwBufLen);
  226. #ifdef UNICODE
  227. #define ImmGetGuideLine ImmGetGuideLineW
  228. #else
  229. #define ImmGetGuideLine ImmGetGuideLineA
  230. #endif // !UNICODE
  231. BOOL WINAPI ImmGetConversionStatus(HIMC, LPDWORD, LPDWORD);
  232. BOOL WINAPI ImmSetConversionStatus(HIMC, DWORD, DWORD);
  233. BOOL WINAPI ImmGetOpenStatus(HIMC);
  234. BOOL WINAPI ImmSetOpenStatus(HIMC, BOOL);
  235. #ifdef _WINGDI_
  236. #ifndef NOGDI
  237. BOOL WINAPI ImmGetCompositionFontA(HIMC, LPLOGFONTA);
  238. BOOL WINAPI ImmGetCompositionFontW(HIMC, LPLOGFONTW);
  239. #ifdef UNICODE
  240. #define ImmGetCompositionFont ImmGetCompositionFontW
  241. #else
  242. #define ImmGetCompositionFont ImmGetCompositionFontA
  243. #endif // !UNICODE
  244. BOOL WINAPI ImmSetCompositionFontA(HIMC, LPLOGFONTA);
  245. BOOL WINAPI ImmSetCompositionFontW(HIMC, LPLOGFONTW);
  246. #ifdef UNICODE
  247. #define ImmSetCompositionFont ImmSetCompositionFontW
  248. #else
  249. #define ImmSetCompositionFont ImmSetCompositionFontA
  250. #endif // !UNICODE
  251. #endif // ifndef NOGDI
  252. #endif // ifdef _WINGDI_
  253. BOOL WINAPI ImmConfigureIMEA(HKL, HWND, DWORD, LPVOID);
  254. BOOL WINAPI ImmConfigureIMEW(HKL, HWND, DWORD, LPVOID);
  255. #ifdef UNICODE
  256. #define ImmConfigureIME ImmConfigureIMEW
  257. #else
  258. #define ImmConfigureIME ImmConfigureIMEA
  259. #endif // !UNICODE
  260. LRESULT WINAPI ImmEscapeA(HKL, HIMC, UINT, LPVOID);
  261. LRESULT WINAPI ImmEscapeW(HKL, HIMC, UINT, LPVOID);
  262. #ifdef UNICODE
  263. #define ImmEscape ImmEscapeW
  264. #else
  265. #define ImmEscape ImmEscapeA
  266. #endif // !UNICODE
  267. DWORD WINAPI ImmGetConversionListA(HKL, HIMC, LPCSTR, LPCANDIDATELIST, DWORD dwBufLen, UINT uFlag);
  268. DWORD WINAPI ImmGetConversionListW(HKL, HIMC, LPCWSTR, LPCANDIDATELIST, DWORD dwBufLen, UINT uFlag);
  269. #ifdef UNICODE
  270. #define ImmGetConversionList ImmGetConversionListW
  271. #else
  272. #define ImmGetConversionList ImmGetConversionListA
  273. #endif // !UNICODE
  274. BOOL WINAPI ImmNotifyIME(HIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue);
  275. BOOL WINAPI ImmGetStatusWindowPos(HIMC, LPPOINT);
  276. BOOL WINAPI ImmSetStatusWindowPos(HIMC, LPPOINT);
  277. BOOL WINAPI ImmGetCompositionWindow(HIMC, LPCOMPOSITIONFORM);
  278. BOOL WINAPI ImmSetCompositionWindow(HIMC, LPCOMPOSITIONFORM);
  279. BOOL WINAPI ImmGetCandidateWindow(HIMC, DWORD, LPCANDIDATEFORM);
  280. BOOL WINAPI ImmSetCandidateWindow(HIMC, LPCANDIDATEFORM);
  281. BOOL WINAPI ImmIsUIMessageA(HWND, UINT, WPARAM, LPARAM);
  282. BOOL WINAPI ImmIsUIMessageW(HWND, UINT, WPARAM, LPARAM);
  283. #ifdef UNICODE
  284. #define ImmIsUIMessage ImmIsUIMessageW
  285. #else
  286. #define ImmIsUIMessage ImmIsUIMessageA
  287. #endif // !UNICODE
  288. BOOL WINAPI ImmGenerateMessage(HIMC); //
  289. UINT WINAPI ImmGetVirtualKey(HWND);
  290. typedef int (CALLBACK *REGISTERWORDENUMPROCA)(LPCSTR, DWORD, LPCSTR, LPVOID);
  291. typedef int (CALLBACK *REGISTERWORDENUMPROCW)(LPCWSTR, DWORD, LPCWSTR, LPVOID);
  292. #ifdef UNICODE
  293. #define REGISTERWORDENUMPROC REGISTERWORDENUMPROCW
  294. #else
  295. #define REGISTERWORDENUMPROC REGISTERWORDENUMPROCA
  296. #endif // !UNICODE
  297. BOOL WINAPI ImmRegisterWordA(HKL, LPCSTR lpszReading, DWORD, LPCSTR lpszRegister);
  298. BOOL WINAPI ImmRegisterWordW(HKL, LPCWSTR lpszReading, DWORD, LPCWSTR lpszRegister);
  299. #ifdef UNICODE
  300. #define ImmRegisterWord ImmRegisterWordW
  301. #else
  302. #define ImmRegisterWord ImmRegisterWordA
  303. #endif // !UNICODE
  304. BOOL WINAPI ImmUnregisterWordA(HKL, LPCSTR lpszReading, DWORD, LPCSTR lpszUnregister);
  305. BOOL WINAPI ImmUnregisterWordW(HKL, LPCWSTR lpszReading, DWORD, LPCWSTR lpszUnregister);
  306. #ifdef UNICODE
  307. #define ImmUnregisterWord ImmUnregisterWordW
  308. #else
  309. #define ImmUnregisterWord ImmUnregisterWordA
  310. #endif // !UNICODE
  311. UINT WINAPI ImmGetRegisterWordStyleA(HKL, UINT nItem, LPSTYLEBUFA);
  312. UINT WINAPI ImmGetRegisterWordStyleW(HKL, UINT nItem, LPSTYLEBUFW);
  313. #ifdef UNICODE
  314. #define ImmGetRegisterWordStyle ImmGetRegisterWordStyleW
  315. #else
  316. #define ImmGetRegisterWordStyle ImmGetRegisterWordStyleA
  317. #endif // !UNICODE
  318. UINT WINAPI ImmEnumRegisterWordA(HKL, REGISTERWORDENUMPROCA, LPCSTR lpszReading, DWORD, LPCSTR lpszRegister, LPVOID);
  319. UINT WINAPI ImmEnumRegisterWordW(HKL, REGISTERWORDENUMPROCW, LPCWSTR lpszReading, DWORD, LPCWSTR lpszRegister, LPVOID);
  320. #ifdef UNICODE
  321. #define ImmEnumRegisterWord ImmEnumRegisterWordW
  322. #else
  323. #define ImmEnumRegisterWord ImmEnumRegisterWordA
  324. #endif // !UNICODE
  325. // //
  326. // Prototype of soft keyboard APIs //
  327. // //
  328. //
  329. HWND WINAPI ImmCreateSoftKeyboard(UINT, HWND, int, int); //
  330. BOOL WINAPI ImmDestroySoftKeyboard(HWND); //
  331. BOOL WINAPI ImmShowSoftKeyboard(HWND, int); //
  332. //
  333. //
  334. LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC); //
  335. BOOL WINAPI ImmUnlockIMC(HIMC); //
  336. DWORD WINAPI ImmGetIMCLockCount(HIMC); //
  337. //
  338. HIMCC WINAPI ImmCreateIMCC(DWORD); //
  339. HIMCC WINAPI ImmDestroyIMCC(HIMCC); //
  340. LPVOID WINAPI ImmLockIMCC(HIMCC); //
  341. BOOL WINAPI ImmUnlockIMCC(HIMCC); //
  342. DWORD WINAPI ImmGetIMCCLockCount(HIMCC); //
  343. HIMCC WINAPI ImmReSizeIMCC(HIMCC, DWORD); //
  344. DWORD WINAPI ImmGetIMCCSize(HIMCC); //
  345. //
  346. //
  347. // the window extra offset //
  348. #define IMMGWL_IMC 0 //
  349. #define IMMGWL_PRIVATE (sizeof(LONG)) //
  350. //
  351. //
  352. // wParam for WM_IME_CONTROL
  353. #define IMC_GETCANDIDATEPOS 0x0007
  354. #define IMC_SETCANDIDATEPOS 0x0008
  355. #define IMC_GETCOMPOSITIONFONT 0x0009
  356. #define IMC_SETCOMPOSITIONFONT 0x000A
  357. #define IMC_GETCOMPOSITIONWINDOW 0x000B
  358. #define IMC_SETCOMPOSITIONWINDOW 0x000C
  359. #define IMC_GETSTATUSWINDOWPOS 0x000F
  360. #define IMC_SETSTATUSWINDOWPOS 0x0010
  361. #define IMC_CLOSESTATUSWINDOW 0x0021
  362. #define IMC_OPENSTATUSWINDOW 0x0022
  363. // for NI_CONTEXTUPDATED //
  364. #define IMC_SETCONVERSIONMODE 0x0002 //
  365. #define IMC_SETSENTENCEMODE 0x0004 //
  366. #define IMC_SETOPENSTATUS 0x0006 //
  367. // wParam for WM_IME_CONTROL to the soft keyboard
  368. #define IMC_GETSOFTKBDFONT 0x0011 //
  369. #define IMC_SETSOFTKBDFONT 0x0012 //
  370. #define IMC_GETSOFTKBDPOS 0x0013 //
  371. #define IMC_SETSOFTKBDPOS 0x0014 //
  372. #define IMC_GETSOFTKBDSUBTYPE 0x0015 //
  373. #define IMC_SETSOFTKBDSUBTYPE 0x0016 //
  374. #define IMC_SETSOFTKBDDATA 0x0018 //
  375. //
  376. //
  377. // dwAction for ImmNotifyIME
  378. #define NI_CONTEXTUPDATED 0x0003 //
  379. #define NI_OPENCANDIDATE 0x0010
  380. #define NI_CLOSECANDIDATE 0x0011
  381. #define NI_SELECTCANDIDATESTR 0x0012
  382. #define NI_CHANGECANDIDATELIST 0x0013
  383. #define NI_FINALIZECONVERSIONRESULT 0x0014
  384. #define NI_COMPOSITIONSTR 0x0015
  385. #define NI_SETCANDIDATE_PAGESTART 0x0016
  386. #define NI_SETCANDIDATE_PAGESIZE 0x0017
  387. // lParam for WM_IME_SETCONTEXT
  388. #define ISC_SHOWUICANDIDATEWINDOW 0x00000001
  389. #define ISC_SHOWUICOMPOSITIONWINDOW 0x80000000
  390. #define ISC_SHOWUIGUIDELINE 0x40000000
  391. #define ISC_SHOWUIALLCANDIDATEWINDOW 0x0000000F
  392. #define ISC_SHOWUIALL 0xC000000F
  393. // dwIndex for ImmNotifyIME/NI_COMPOSITIONSTR
  394. #define CPS_COMPLETE 0x0001
  395. #define CPS_CONVERT 0x0002
  396. #define CPS_REVERT 0x0003
  397. #define CPS_CANCEL 0x0004
  398. // the modifiers of hot key
  399. #define MOD_ALT 0x0001
  400. #define MOD_CONTROL 0x0002
  401. #define MOD_SHIFT 0x0004
  402. #define MOD_LEFT 0x8000
  403. #define MOD_RIGHT 0x4000
  404. #define MOD_ON_KEYUP 0x0800
  405. #define MOD_IGNORE_ALL_MODIFIER 0x0400
  406. // Windows for Simplified Chinese Edition hot key ID from 0x10 - 0x2F
  407. #define IME_CHOTKEY_IME_NONIME_TOGGLE 0x10
  408. #define IME_CHOTKEY_SHAPE_TOGGLE 0x11
  409. #define IME_CHOTKEY_SYMBOL_TOGGLE 0x12
  410. // Windows for Japanese Edition hot key ID from 0x30 - 0x4F
  411. #define IME_JHOTKEY_CLOSE_OPEN 0x30
  412. // Windows for Korean Edition hot key ID from 0x50 - 0x6F
  413. #define IME_KHOTKEY_SHAPE_TOGGLE 0x50
  414. #define IME_KHOTKEY_HANJACONVERT 0x51
  415. #define IME_KHOTKEY_ENGLISH 0x52
  416. // Windows for Tranditional Chinese Edition hot key ID from 0x70 - 0x8F
  417. #define IME_THOTKEY_IME_NONIME_TOGGLE 0x70
  418. #define IME_THOTKEY_SHAPE_TOGGLE 0x71
  419. #define IME_THOTKEY_SYMBOL_TOGGLE 0x72
  420. // direct switch hot key ID from 0x100 - 0x11F
  421. #define IME_HOTKEY_DSWITCH_FIRST 0x100
  422. #define IME_HOTKEY_DSWITCH_LAST 0x11F
  423. // IME private hot key from 0x200 - 0x21F
  424. #define IME_ITHOTKEY_RESEND_RESULTSTR 0x200
  425. #define IME_ITHOTKEY_PREVIOUS_COMPOSITION 0x201
  426. #define IME_ITHOTKEY_UISTYLE_TOGGLE 0x202
  427. // parameter of ImmGetCompositionString
  428. #define GCS_COMPREADSTR 0x0001
  429. #define GCS_COMPREADATTR 0x0002
  430. #define GCS_COMPREADCLAUSE 0x0004
  431. #define GCS_COMPSTR 0x0008
  432. #define GCS_COMPATTR 0x0010
  433. #define GCS_COMPCLAUSE 0x0020
  434. #define GCS_CURSORPOS 0x0080
  435. #define GCS_DELTASTART 0x0100
  436. #define GCS_RESULTREADSTR 0x0200
  437. #define GCS_RESULTREADCLAUSE 0x0400
  438. #define GCS_RESULTSTR 0x0800
  439. #define GCS_RESULTCLAUSE 0x1000
  440. // style bit flags for WM_IME_COMPOSITION
  441. #define CS_INSERTCHAR 0x2000
  442. #define CS_NOMOVECARET 0x4000
  443. #define GCS_COMP (GCS_COMPSTR|GCS_COMPATTR|GCS_COMPCLAUSE) //
  444. #define GCS_COMPREAD (GCS_COMPREADSTR|GCS_COMPREADATTR |GCS_COMPREADCLAUSE) //
  445. #define GCS_RESULT (GCS_RESULTSTR|GCS_RESULTCLAUSE) //
  446. #define GCS_RESULTREAD (GCS_RESULTREADSTR|GCS_RESULTREADCLAUSE) //
  447. // bits of fdwInit of INPUTCONTEXT
  448. #define INIT_STATUSWNDPOS 0x00000001 //
  449. #define INIT_CONVERSION 0x00000002 //
  450. #define INIT_SENTENCE 0x00000004 //
  451. #define INIT_LOGFONT 0x00000008 //
  452. #define INIT_COMPFORM 0x00000010 //
  453. #define INIT_SOFTKBDPOS 0x00000020 //
  454. //
  455. //
  456. // IME version constants
  457. #define IMEVER_0310 0x0003000A
  458. #define IMEVER_0400 0x00040000
  459. // IME property bits
  460. #define IME_PROP_END_UNLOAD 0x0001 //
  461. #define IME_PROP_KBD_CHAR_FIRST 0x0002 //
  462. #define IME_PROP_IGNORE_UPKEYS 0x0004 //
  463. #define IME_PROP_NEED_ALTKEY 0x0008 //
  464. #define IME_PROP_NO_KEYS_ON_CLOSE 0x0010 //
  465. #define IME_PROP_AT_CARET 0x00010000
  466. #define IME_PROP_SPECIAL_UI 0x00020000
  467. #define IME_PROP_CANDLIST_START_FROM_1 0x00040000
  468. #define IME_PROP_UNICODE 0x00080000
  469. // IME UICapability bits
  470. #define UI_CAP_2700 0x00000001
  471. #define UI_CAP_ROT90 0x00000002
  472. #define UI_CAP_ROTANY 0x00000004
  473. #define UI_CAP_SOFTKBD 0x00010000 //
  474. // ImmSetCompositionString Capability bits
  475. #define SCS_CAP_COMPSTR 0x00000001
  476. #define SCS_CAP_MAKEREAD 0x00000002
  477. // IME WM_IME_SELECT inheritance Capability bits
  478. #define SELECT_CAP_CONVERSION 0x00000001
  479. #define SELECT_CAP_SENTENCE 0x00000002
  480. // ID for deIndex of ImmGetGuideLine
  481. #define GGL_LEVEL 0x00000001
  482. #define GGL_INDEX 0x00000002
  483. #define GGL_STRING 0x00000003
  484. #define GGL_PRIVATE 0x00000004
  485. // ID for dwLevel of GUIDELINE Structure
  486. #define GL_LEVEL_NOGUIDELINE 0x00000000
  487. #define GL_LEVEL_FATAL 0x00000001
  488. #define GL_LEVEL_ERROR 0x00000002
  489. #define GL_LEVEL_WARNING 0x00000003
  490. #define GL_LEVEL_INFORMATION 0x00000004
  491. // ID for dwIndex of GUIDELINE Structure
  492. #define GL_ID_UNKNOWN 0x00000000
  493. #define GL_ID_NOMODULE 0x00000001
  494. #define GL_ID_NODICTIONARY 0x00000010
  495. #define GL_ID_CANNOTSAVE 0x00000011
  496. #define GL_ID_NOCONVERT 0x00000020
  497. #define GL_ID_TYPINGERROR 0x00000021
  498. #define GL_ID_TOOMANYSTROKE 0x00000022
  499. #define GL_ID_READINGCONFLICT 0x00000023
  500. #define GL_ID_INPUTREADING 0x00000024
  501. #define GL_ID_INPUTRADICAL 0x00000025
  502. #define GL_ID_INPUTCODE 0x00000026
  503. #define GL_ID_INPUTSYMBOL 0x00000027
  504. #define GL_ID_CHOOSECANDIDATE 0x00000028
  505. #define GL_ID_REVERSECONVERSION 0x00000029
  506. #define GL_ID_PRIVATE_FIRST 0x00008000
  507. #define GL_ID_PRIVATE_LAST 0x0000FFFF
  508. // ID for dwIndex of ImmGetProperty
  509. #define IGP_GETIMEVERSION (DWORD)(-4)
  510. #define IGP_PROPERTY 0x00000004
  511. #define IGP_CONVERSION 0x00000008
  512. #define IGP_SENTENCE 0x0000000c
  513. #define IGP_UI 0x00000010
  514. #define IGP_SETCOMPSTR 0x00000014
  515. #define IGP_SELECT 0x00000018
  516. // dwIndex for ImmSetCompositionString API
  517. #define SCS_SETSTR (GCS_COMPREADSTR|GCS_COMPSTR)
  518. #define SCS_CHANGEATTR (GCS_COMPREADATTR|GCS_COMPATTR)
  519. #define SCS_CHANGECLAUSE (GCS_COMPREADCLAUSE|GCS_COMPCLAUSE)
  520. // attribute for COMPOSITIONSTRING Structure
  521. #define ATTR_INPUT 0x00
  522. #define ATTR_TARGET_CONVERTED 0x01
  523. #define ATTR_CONVERTED 0x02
  524. #define ATTR_TARGET_NOTCONVERTED 0x03
  525. #define ATTR_INPUT_ERROR 0x04
  526. // bit field for IMC_SETCOMPOSITIONWINDOW, IMC_SETCANDIDATEWINDOW
  527. #define CFS_DEFAULT 0x0000
  528. #define CFS_RECT 0x0001
  529. #define CFS_POINT 0x0002
  530. #define CFS_FORCE_POSITION 0x0020
  531. #define CFS_CANDIDATEPOS 0x0040
  532. #define CFS_EXCLUDE 0x0080
  533. // conversion direction for ImmGetConversionList
  534. #define GCL_CONVERSION 0x0001
  535. #define GCL_REVERSECONVERSION 0x0002
  536. #define GCL_REVERSE_LENGTH 0x0003
  537. // bit field for conversion mode
  538. #define IME_CMODE_ALPHANUMERIC 0x0000
  539. #define IME_CMODE_NATIVE 0x0001
  540. #define IME_CMODE_CHINESE IME_CMODE_NATIVE
  541. #define IME_CMODE_HANGEUL IME_CMODE_NATIVE
  542. #define IME_CMODE_JAPANESE IME_CMODE_NATIVE
  543. #define IME_CMODE_KATAKANA 0x0002 // only effect under IME_CMODE_NATIVE
  544. #define IME_CMODE_LANGUAGE 0x0003
  545. #define IME_CMODE_FULLSHAPE 0x0008
  546. #define IME_CMODE_ROMAN 0x0010
  547. #define IME_CMODE_CHARCODE 0x0020
  548. #define IME_CMODE_HANJACONVERT 0x0040
  549. #define IME_CMODE_SOFTKBD 0x0080
  550. #define IME_CMODE_NOCONVERSION 0x0100
  551. #define IME_CMODE_EUDC 0x0200
  552. #define IME_CMODE_SYMBOL 0x0400
  553. #define IME_SMODE_NONE 0x0000
  554. #define IME_SMODE_PLAURALCLAUSE 0x0001
  555. #define IME_SMODE_SINGLECONVERT 0x0002
  556. #define IME_SMODE_AUTOMATIC 0x0004
  557. #define IME_SMODE_PHRASEPREDICT 0x0008
  558. // style of candidate
  559. #define IME_CAND_UNKNOWN 0x0000
  560. #define IME_CAND_READ 0x0001
  561. #define IME_CAND_CODE 0x0002
  562. #define IME_CAND_MEANING 0x0003
  563. #define IME_CAND_RADICAL 0x0004
  564. #define IME_CAND_STROKE 0x0005
  565. // wParam of report message WM_IME_NOTIFY
  566. #define IMN_CLOSESTATUSWINDOW 0x0001
  567. #define IMN_OPENSTATUSWINDOW 0x0002
  568. #define IMN_CHANGECANDIDATE 0x0003
  569. #define IMN_CLOSECANDIDATE 0x0004
  570. #define IMN_OPENCANDIDATE 0x0005
  571. #define IMN_SETCONVERSIONMODE 0x0006
  572. #define IMN_SETSENTENCEMODE 0x0007
  573. #define IMN_SETOPENSTATUS 0x0008
  574. #define IMN_SETCANDIDATEPOS 0x0009
  575. #define IMN_SETCOMPOSITIONFONT 0x000A
  576. #define IMN_SETCOMPOSITIONWINDOW 0x000B
  577. #define IMN_SETSTATUSWINDOWPOS 0x000C
  578. #define IMN_GUIDELINE 0x000D
  579. #define IMN_PRIVATE 0x000E
  580. #define IMN_SOFTKBDDESTROYED 0x0011 //
  581. //
  582. //
  583. // error code of ImmGetCompositionString
  584. #define IMM_ERROR_NODATA (-1)
  585. #define IMM_ERROR_GENERAL (-2)
  586. // dialog mode of ImmConfigureIME
  587. #define IME_CONFIG_GENERAL 1
  588. #define IME_CONFIG_REGISTERWORD 2
  589. #define IME_CONFIG_SELECTDICTIONARY 3
  590. // dialog mode of ImmEscape
  591. #define IME_ESC_QUERY_SUPPORT 0x0003
  592. #define IME_ESC_RESERVED_FIRST 0x0004
  593. #define IME_ESC_RESERVED_LAST 0x07FF
  594. #define IME_ESC_PRIVATE_FIRST 0x0800
  595. #define IME_ESC_PRIVATE_LAST 0x0FFF
  596. #define IME_ESC_SEQUENCE_TO_INTERNAL 0x1001
  597. #define IME_ESC_GET_EUDC_DICTIONARY 0x1003
  598. #define IME_ESC_SET_EUDC_DICTIONARY 0x1004
  599. #define IME_ESC_MAX_KEY 0x1005
  600. #define IME_ESC_IME_NAME 0x1006
  601. #define IME_ESC_SYNC_HOTKEY 0x1007
  602. #define IME_ESC_HANJA_MODE 0x1008
  603. #define IME_ESC_AUTOMATA 0x1009
  604. // style of word registration
  605. #define IME_REGWORD_STYLE_EUDC 0x00000001
  606. #define IME_REGWORD_STYLE_USER_FIRST 0x80000000
  607. #define IME_REGWORD_STYLE_USER_LAST 0xFFFFFFFF
  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. // protype of IME APIs //
  614. BOOL WINAPI ImeInquire(LPIMEINFO, LPTSTR lpszUIClass, LPCTSTR lpszOptions); //
  615. BOOL WINAPI ImeConfigure(HKL, HWND, DWORD, LPVOID); //
  616. DWORD WINAPI ImeConversionList(HIMC, LPCTSTR, LPCANDIDATELIST, DWORD dwBufLen, UINT uFlag); //
  617. BOOL WINAPI ImeDestroy(UINT); //
  618. LRESULT WINAPI ImeEscape(HIMC, UINT, LPVOID); //
  619. BOOL WINAPI ImeProcessKey(HIMC, UINT, LPARAM, CONST LPBYTE); //
  620. BOOL WINAPI ImeSelect(HIMC, BOOL); //
  621. BOOL WINAPI ImeSetActiveContext(HIMC, BOOL); //
  622. UINT WINAPI ImeToAsciiEx(UINT uVirtKey, UINT uScaCode, CONST LPBYTE lpbKeyState, LPDWORD lpdwTransBuf, UINT fuState, HIMC); //
  623. BOOL WINAPI NotifyIME(HIMC, DWORD, DWORD, DWORD); //
  624. BOOL WINAPI ImeRegisterWord(LPCTSTR, DWORD, LPCTSTR); //
  625. BOOL WINAPI ImeUnregisterWord(LPCTSTR, DWORD, LPCTSTR); //
  626. UINT WINAPI ImeGetRegisterWordStyle(UINT nItem, LPSTYLEBUF); //
  627. UINT WINAPI ImeEnumRegisterWord(REGISTERWORDENUMPROC, LPCTSTR, DWORD, LPCTSTR, LPVOID); //
  628. BOOL WINAPI ImeSetCompositionString(HIMC, DWORD dwIndex, LPCVOID lpComp, DWORD, LPCVOID lpRead, DWORD); //
  629. //
  630. //
  631. #ifdef __cplusplus
  632. }
  633. #endif
  634. #endif // _IMM_