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.

1231 lines
44 KiB

  1. /*++ BUILD Version: 0002 // Increment this if a change has global effects
  2. *
  3. * Copyright (c) Microsoft Corporation. All rights reserved.
  4. *
  5. * Module Name:
  6. *
  7. * immp.h
  8. *
  9. * Abstract:
  10. *
  11. * Private
  12. * Procedure declarations, constant definitions and macros for IMM.
  13. *
  14. */
  15. #ifndef _IMMP_
  16. #define _IMMP_
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #ifndef _IMM_SDK_DEFINED_
  21. #define _IMM_SDK_DEFINED_
  22. #if (WINVER >= 0x040A)
  23. DECLARE_HANDLE(HIMC);
  24. DECLARE_HANDLE(HIMCC);
  25. #else
  26. typedef DWORD HIMC;
  27. typedef DWORD HIMCC;
  28. #endif /* WINVER >= 0x040A */
  29. typedef HKL FAR *LPHKL;
  30. typedef UINT FAR *LPUINT;
  31. typedef struct tagCOMPOSITIONFORM {
  32. DWORD dwStyle;
  33. POINT ptCurrentPos;
  34. RECT rcArea;
  35. } COMPOSITIONFORM, *PCOMPOSITIONFORM, NEAR *NPCOMPOSITIONFORM, FAR *LPCOMPOSITIONFORM;
  36. typedef struct tagCANDIDATEFORM {
  37. DWORD dwIndex;
  38. DWORD dwStyle;
  39. POINT ptCurrentPos;
  40. RECT rcArea;
  41. } CANDIDATEFORM, *PCANDIDATEFORM, NEAR *NPCANDIDATEFORM, FAR *LPCANDIDATEFORM;
  42. typedef struct tagCANDIDATELIST {
  43. DWORD dwSize;
  44. DWORD dwStyle;
  45. DWORD dwCount;
  46. DWORD dwSelection;
  47. DWORD dwPageStart;
  48. DWORD dwPageSize;
  49. DWORD dwOffset[1];
  50. } CANDIDATELIST, *PCANDIDATELIST, NEAR *NPCANDIDATELIST, FAR *LPCANDIDATELIST;
  51. typedef struct tagREGISTERWORDA {
  52. LPSTR lpReading;
  53. LPSTR lpWord;
  54. } REGISTERWORDA, *PREGISTERWORDA, NEAR *NPREGISTERWORDA, FAR *LPREGISTERWORDA;
  55. typedef struct tagREGISTERWORDW {
  56. LPWSTR lpReading;
  57. LPWSTR lpWord;
  58. } REGISTERWORDW, *PREGISTERWORDW, NEAR *NPREGISTERWORDW, FAR *LPREGISTERWORDW;
  59. #ifdef UNICODE
  60. typedef REGISTERWORDW REGISTERWORD;
  61. typedef PREGISTERWORDW PREGISTERWORD;
  62. typedef NPREGISTERWORDW NPREGISTERWORD;
  63. typedef LPREGISTERWORDW LPREGISTERWORD;
  64. #else
  65. typedef REGISTERWORDA REGISTERWORD;
  66. typedef PREGISTERWORDA PREGISTERWORD;
  67. typedef NPREGISTERWORDA NPREGISTERWORD;
  68. typedef LPREGISTERWORDA LPREGISTERWORD;
  69. #endif // UNICODE
  70. #if (WINVER >= 0x040A)
  71. typedef struct tagRECONVERTSTRING {
  72. DWORD dwSize;
  73. DWORD dwVersion;
  74. DWORD dwStrLen;
  75. DWORD dwStrOffset;
  76. DWORD dwCompStrLen;
  77. DWORD dwCompStrOffset;
  78. DWORD dwTargetStrLen;
  79. DWORD dwTargetStrOffset;
  80. } RECONVERTSTRING, *PRECONVERTSTRING, NEAR *NPRECONVERTSTRING, FAR *LPRECONVERTSTRING;
  81. #endif /* WINVER >= 0x040A */
  82. #define STYLE_DESCRIPTION_SIZE 32
  83. typedef struct tagSTYLEBUFA {
  84. DWORD dwStyle;
  85. CHAR szDescription[STYLE_DESCRIPTION_SIZE];
  86. } STYLEBUFA, *PSTYLEBUFA, NEAR *NPSTYLEBUFA, FAR *LPSTYLEBUFA;
  87. typedef struct tagSTYLEBUFW {
  88. DWORD dwStyle;
  89. WCHAR szDescription[STYLE_DESCRIPTION_SIZE];
  90. } STYLEBUFW, *PSTYLEBUFW, NEAR *NPSTYLEBUFW, FAR *LPSTYLEBUFW;
  91. #ifdef UNICODE
  92. typedef STYLEBUFW STYLEBUF;
  93. typedef PSTYLEBUFW PSTYLEBUF;
  94. typedef NPSTYLEBUFW NPSTYLEBUF;
  95. typedef LPSTYLEBUFW LPSTYLEBUF;
  96. #else
  97. typedef STYLEBUFA STYLEBUF;
  98. typedef PSTYLEBUFA PSTYLEBUF;
  99. typedef NPSTYLEBUFA NPSTYLEBUF;
  100. typedef LPSTYLEBUFA LPSTYLEBUF;
  101. #endif // UNICODE
  102. #if (WINVER >= 0x040A)
  103. #define IMEMENUITEM_STRING_SIZE 80
  104. typedef struct tagIMEMENUITEMINFOA {
  105. UINT cbSize;
  106. UINT fType;
  107. UINT fState;
  108. UINT wID;
  109. HBITMAP hbmpChecked;
  110. HBITMAP hbmpUnchecked;
  111. DWORD dwItemData;
  112. CHAR szString[IMEMENUITEM_STRING_SIZE];
  113. HBITMAP hbmpItem;
  114. } IMEMENUITEMINFOA, *PIMEMENUITEMINFOA, NEAR *NPIMEMENUITEMINFOA, FAR *LPIMEMENUITEMINFOA;
  115. typedef struct tagIMEMENUITEMINFOW {
  116. UINT cbSize;
  117. UINT fType;
  118. UINT fState;
  119. UINT wID;
  120. HBITMAP hbmpChecked;
  121. HBITMAP hbmpUnchecked;
  122. DWORD dwItemData;
  123. WCHAR szString[IMEMENUITEM_STRING_SIZE];
  124. HBITMAP hbmpItem;
  125. } IMEMENUITEMINFOW, *PIMEMENUITEMINFOW, NEAR *NPIMEMENUITEMINFOW, FAR *LPIMEMENUITEMINFOW;
  126. #ifdef UNICODE
  127. typedef IMEMENUITEMINFOW IMEMENUITEMINFO;
  128. typedef PIMEMENUITEMINFOW PIMEMENUITEMINFO;
  129. typedef NPIMEMENUITEMINFOW NPIMEMENUITEMINFO;
  130. typedef LPIMEMENUITEMINFOW LPIMEMENUITEMINFO;
  131. #else
  132. typedef IMEMENUITEMINFOA IMEMENUITEMINFO;
  133. typedef PIMEMENUITEMINFOA PIMEMENUITEMINFO;
  134. typedef NPIMEMENUITEMINFOA NPIMEMENUITEMINFO;
  135. typedef LPIMEMENUITEMINFOA LPIMEMENUITEMINFO;
  136. #endif // UNICODE
  137. typedef struct tagIMECHARPOSITION {
  138. DWORD dwSize;
  139. DWORD dwCharPos;
  140. POINT pt;
  141. UINT cLineHeight;
  142. RECT rcDocument;
  143. } IMECHARPOSITION, *PIMECHARPOSITION, NEAR *NPIMECHARPOSITION, FAR *LPIMECHARPOSITION;
  144. typedef BOOL (CALLBACK* IMCENUMPROC)(HIMC, LPARAM);
  145. #endif /* WINVER >= 0x040A */
  146. // prototype of IMM API
  147. HKL WINAPI ImmInstallIMEA(IN LPCSTR lpszIMEFileName, IN LPCSTR lpszLayoutText);
  148. HKL WINAPI ImmInstallIMEW(IN LPCWSTR lpszIMEFileName, IN LPCWSTR lpszLayoutText);
  149. #ifdef UNICODE
  150. #define ImmInstallIME ImmInstallIMEW
  151. #else
  152. #define ImmInstallIME ImmInstallIMEA
  153. #endif // !UNICODE
  154. HWND WINAPI ImmGetDefaultIMEWnd(IN HWND);
  155. UINT WINAPI ImmGetDescriptionA(IN HKL, OUT LPSTR, IN UINT uBufLen);
  156. UINT WINAPI ImmGetDescriptionW(IN HKL, OUT LPWSTR, IN UINT uBufLen);
  157. #ifdef UNICODE
  158. #define ImmGetDescription ImmGetDescriptionW
  159. #else
  160. #define ImmGetDescription ImmGetDescriptionA
  161. #endif // !UNICODE
  162. UINT WINAPI ImmGetIMEFileNameA(IN HKL, OUT LPSTR, IN UINT uBufLen);
  163. UINT WINAPI ImmGetIMEFileNameW(IN HKL, OUT LPWSTR, IN UINT uBufLen);
  164. #ifdef UNICODE
  165. #define ImmGetIMEFileName ImmGetIMEFileNameW
  166. #else
  167. #define ImmGetIMEFileName ImmGetIMEFileNameA
  168. #endif // !UNICODE
  169. DWORD WINAPI ImmGetProperty(IN HKL, IN DWORD);
  170. BOOL WINAPI ImmIsIME(IN HKL);
  171. BOOL WINAPI ImmSimulateHotKey(IN HWND, IN DWORD);
  172. HIMC WINAPI ImmCreateContext(void);
  173. BOOL WINAPI ImmDestroyContext(IN HIMC);
  174. HIMC WINAPI ImmGetContext(IN HWND);
  175. BOOL WINAPI ImmReleaseContext(IN HWND, IN HIMC);
  176. HIMC WINAPI ImmAssociateContext(IN HWND, IN HIMC);
  177. #if (WINVER >= 0x040A)
  178. BOOL WINAPI ImmAssociateContextEx(IN HWND, IN HIMC, IN DWORD);
  179. #endif /* WINVER >= 0x040A */
  180. LONG WINAPI ImmGetCompositionStringA(IN HIMC, IN DWORD, OUT LPVOID, IN DWORD);
  181. LONG WINAPI ImmGetCompositionStringW(IN HIMC, IN DWORD, OUT LPVOID, IN DWORD);
  182. #ifdef UNICODE
  183. #define ImmGetCompositionString ImmGetCompositionStringW
  184. #else
  185. #define ImmGetCompositionString ImmGetCompositionStringA
  186. #endif // !UNICODE
  187. BOOL WINAPI ImmSetCompositionStringA(IN HIMC, IN DWORD dwIndex, IN LPVOID lpComp, IN DWORD, IN LPVOID lpRead, IN DWORD);
  188. BOOL WINAPI ImmSetCompositionStringW(IN HIMC, IN DWORD dwIndex, IN LPVOID lpComp, IN DWORD, IN LPVOID lpRead, IN DWORD);
  189. #ifdef UNICODE
  190. #define ImmSetCompositionString ImmSetCompositionStringW
  191. #else
  192. #define ImmSetCompositionString ImmSetCompositionStringA
  193. #endif // !UNICODE
  194. DWORD WINAPI ImmGetCandidateListCountA(IN HIMC, OUT LPDWORD lpdwListCount);
  195. DWORD WINAPI ImmGetCandidateListCountW(IN HIMC, OUT LPDWORD lpdwListCount);
  196. #ifdef UNICODE
  197. #define ImmGetCandidateListCount ImmGetCandidateListCountW
  198. #else
  199. #define ImmGetCandidateListCount ImmGetCandidateListCountA
  200. #endif // !UNICODE
  201. DWORD WINAPI ImmGetCandidateListA(IN HIMC, IN DWORD deIndex, OUT LPCANDIDATELIST, IN DWORD dwBufLen);
  202. DWORD WINAPI ImmGetCandidateListW(IN HIMC, IN DWORD deIndex, OUT LPCANDIDATELIST, IN DWORD dwBufLen);
  203. #ifdef UNICODE
  204. #define ImmGetCandidateList ImmGetCandidateListW
  205. #else
  206. #define ImmGetCandidateList ImmGetCandidateListA
  207. #endif // !UNICODE
  208. DWORD WINAPI ImmGetGuideLineA(IN HIMC, IN DWORD dwIndex, OUT LPSTR, IN DWORD dwBufLen);
  209. DWORD WINAPI ImmGetGuideLineW(IN HIMC, IN DWORD dwIndex, OUT LPWSTR, IN DWORD dwBufLen);
  210. #ifdef UNICODE
  211. #define ImmGetGuideLine ImmGetGuideLineW
  212. #else
  213. #define ImmGetGuideLine ImmGetGuideLineA
  214. #endif // !UNICODE
  215. BOOL WINAPI ImmGetConversionStatus(IN HIMC, OUT LPDWORD, OUT LPDWORD);
  216. BOOL WINAPI ImmSetConversionStatus(IN HIMC, IN DWORD, IN DWORD);
  217. BOOL WINAPI ImmGetOpenStatus(IN HIMC);
  218. BOOL WINAPI ImmSetOpenStatus(IN HIMC, IN BOOL);
  219. #if defined(_WINGDI_) && !defined(NOGDI)
  220. BOOL WINAPI ImmGetCompositionFontA(IN HIMC, OUT LPLOGFONTA);
  221. BOOL WINAPI ImmGetCompositionFontW(IN HIMC, OUT LPLOGFONTW);
  222. #ifdef UNICODE
  223. #define ImmGetCompositionFont ImmGetCompositionFontW
  224. #else
  225. #define ImmGetCompositionFont ImmGetCompositionFontA
  226. #endif // !UNICODE
  227. BOOL WINAPI ImmSetCompositionFontA(IN HIMC, IN LPLOGFONTA);
  228. BOOL WINAPI ImmSetCompositionFontW(IN HIMC, IN LPLOGFONTW);
  229. #ifdef UNICODE
  230. #define ImmSetCompositionFont ImmSetCompositionFontW
  231. #else
  232. #define ImmSetCompositionFont ImmSetCompositionFontA
  233. #endif // !UNICODE
  234. #endif // defined(_WINGDI_) && !defined(NOGDI)
  235. BOOL WINAPI ImmConfigureIMEA(IN HKL, IN HWND, IN DWORD, IN LPVOID);
  236. BOOL WINAPI ImmConfigureIMEW(IN HKL, IN HWND, IN DWORD, IN LPVOID);
  237. #ifdef UNICODE
  238. #define ImmConfigureIME ImmConfigureIMEW
  239. #else
  240. #define ImmConfigureIME ImmConfigureIMEA
  241. #endif // !UNICODE
  242. LRESULT WINAPI ImmEscapeA(IN HKL, IN HIMC, IN UINT, IN LPVOID);
  243. LRESULT WINAPI ImmEscapeW(IN HKL, IN HIMC, IN UINT, IN LPVOID);
  244. #ifdef UNICODE
  245. #define ImmEscape ImmEscapeW
  246. #else
  247. #define ImmEscape ImmEscapeA
  248. #endif // !UNICODE
  249. DWORD WINAPI ImmGetConversionListA(IN HKL, IN HIMC, IN LPCSTR, OUT LPCANDIDATELIST, IN DWORD dwBufLen, IN UINT uFlag);
  250. DWORD WINAPI ImmGetConversionListW(IN HKL, IN HIMC, IN LPCWSTR, OUT LPCANDIDATELIST, IN DWORD dwBufLen, IN UINT uFlag);
  251. #ifdef UNICODE
  252. #define ImmGetConversionList ImmGetConversionListW
  253. #else
  254. #define ImmGetConversionList ImmGetConversionListA
  255. #endif // !UNICODE
  256. BOOL WINAPI ImmNotifyIME(IN HIMC, IN DWORD dwAction, IN DWORD dwIndex, IN DWORD dwValue);
  257. BOOL WINAPI ImmGetStatusWindowPos(IN HIMC, OUT LPPOINT);
  258. BOOL WINAPI ImmSetStatusWindowPos(IN HIMC, IN LPPOINT);
  259. BOOL WINAPI ImmGetCompositionWindow(IN HIMC, OUT LPCOMPOSITIONFORM);
  260. BOOL WINAPI ImmSetCompositionWindow(IN HIMC, IN LPCOMPOSITIONFORM);
  261. BOOL WINAPI ImmGetCandidateWindow(IN HIMC, IN DWORD, OUT LPCANDIDATEFORM);
  262. BOOL WINAPI ImmSetCandidateWindow(IN HIMC, IN LPCANDIDATEFORM);
  263. BOOL WINAPI ImmIsUIMessageA(IN HWND, IN UINT, IN WPARAM, IN LPARAM);
  264. BOOL WINAPI ImmIsUIMessageW(IN HWND, IN UINT, IN WPARAM, IN LPARAM);
  265. #ifdef UNICODE
  266. #define ImmIsUIMessage ImmIsUIMessageW
  267. #else
  268. #define ImmIsUIMessage ImmIsUIMessageA
  269. #endif // !UNICODE
  270. UINT WINAPI ImmGetVirtualKey(IN HWND);
  271. typedef int (CALLBACK *REGISTERWORDENUMPROCA)(LPCSTR, DWORD, LPCSTR, LPVOID);
  272. typedef int (CALLBACK *REGISTERWORDENUMPROCW)(LPCWSTR, DWORD, LPCWSTR, LPVOID);
  273. #ifdef UNICODE
  274. #define REGISTERWORDENUMPROC REGISTERWORDENUMPROCW
  275. #else
  276. #define REGISTERWORDENUMPROC REGISTERWORDENUMPROCA
  277. #endif // !UNICODE
  278. BOOL WINAPI ImmRegisterWordA(IN HKL, IN LPCSTR lpszReading, IN DWORD, IN LPCSTR lpszRegister);
  279. BOOL WINAPI ImmRegisterWordW(IN HKL, IN LPCWSTR lpszReading, IN DWORD, IN LPCWSTR lpszRegister);
  280. #ifdef UNICODE
  281. #define ImmRegisterWord ImmRegisterWordW
  282. #else
  283. #define ImmRegisterWord ImmRegisterWordA
  284. #endif // !UNICODE
  285. BOOL WINAPI ImmUnregisterWordA(IN HKL, IN LPCSTR lpszReading, IN DWORD, IN LPCSTR lpszUnregister);
  286. BOOL WINAPI ImmUnregisterWordW(IN HKL, IN LPCWSTR lpszReading, IN DWORD, IN LPCWSTR lpszUnregister);
  287. #ifdef UNICODE
  288. #define ImmUnregisterWord ImmUnregisterWordW
  289. #else
  290. #define ImmUnregisterWord ImmUnregisterWordA
  291. #endif // !UNICODE
  292. UINT WINAPI ImmGetRegisterWordStyleA(IN HKL, IN UINT nItem, OUT LPSTYLEBUFA);
  293. UINT WINAPI ImmGetRegisterWordStyleW(IN HKL, IN UINT nItem, OUT LPSTYLEBUFW);
  294. #ifdef UNICODE
  295. #define ImmGetRegisterWordStyle ImmGetRegisterWordStyleW
  296. #else
  297. #define ImmGetRegisterWordStyle ImmGetRegisterWordStyleA
  298. #endif // !UNICODE
  299. UINT WINAPI ImmEnumRegisterWordA(IN HKL, IN REGISTERWORDENUMPROCA, IN LPCSTR lpszReading, IN DWORD, IN LPCSTR lpszRegister, IN LPVOID);
  300. UINT WINAPI ImmEnumRegisterWordW(IN HKL, IN REGISTERWORDENUMPROCW, IN LPCWSTR lpszReading, IN DWORD, IN LPCWSTR lpszRegister, IN LPVOID);
  301. #ifdef UNICODE
  302. #define ImmEnumRegisterWord ImmEnumRegisterWordW
  303. #else
  304. #define ImmEnumRegisterWord ImmEnumRegisterWordA
  305. #endif // !UNICODE
  306. #if (WINVER >= 0x040A)
  307. BOOL WINAPI ImmDisableIME(IN DWORD);
  308. BOOL WINAPI ImmEnumInputContext(DWORD idThread, IMCENUMPROC lpfn, LPARAM lParam);
  309. DWORD WINAPI ImmGetImeMenuItemsA(IN HIMC, IN DWORD, IN DWORD, OUT LPIMEMENUITEMINFOA, OUT LPIMEMENUITEMINFOA, IN DWORD);
  310. DWORD WINAPI ImmGetImeMenuItemsW(IN HIMC, IN DWORD, IN DWORD, OUT LPIMEMENUITEMINFOW, OUT LPIMEMENUITEMINFOW, IN DWORD);
  311. #ifdef UNICODE
  312. #define ImmGetImeMenuItems ImmGetImeMenuItemsW
  313. #else
  314. #define ImmGetImeMenuItems ImmGetImeMenuItemsA
  315. #endif // !UNICODE
  316. BOOL WINAPI ImmDisableTextFrameService(DWORD idThread);
  317. #endif /* WINVER >= 0x040A */
  318. // wParam for WM_IME_CONTROL
  319. #define IMC_GETCANDIDATEPOS 0x0007
  320. #define IMC_SETCANDIDATEPOS 0x0008
  321. #define IMC_GETCOMPOSITIONFONT 0x0009
  322. #define IMC_SETCOMPOSITIONFONT 0x000A
  323. #define IMC_GETCOMPOSITIONWINDOW 0x000B
  324. #define IMC_SETCOMPOSITIONWINDOW 0x000C
  325. #define IMC_GETSTATUSWINDOWPOS 0x000F
  326. #define IMC_SETSTATUSWINDOWPOS 0x0010
  327. #define IMC_CLOSESTATUSWINDOW 0x0021
  328. #define IMC_OPENSTATUSWINDOW 0x0022
  329. // dwAction for ImmNotifyIME
  330. #define NI_OPENCANDIDATE 0x0010
  331. #define NI_CLOSECANDIDATE 0x0011
  332. #define NI_SELECTCANDIDATESTR 0x0012
  333. #define NI_CHANGECANDIDATELIST 0x0013
  334. #define NI_FINALIZECONVERSIONRESULT 0x0014
  335. #define NI_COMPOSITIONSTR 0x0015
  336. #define NI_SETCANDIDATE_PAGESTART 0x0016
  337. #define NI_SETCANDIDATE_PAGESIZE 0x0017
  338. #define NI_IMEMENUSELECTED 0x0018
  339. // lParam for WM_IME_SETCONTEXT
  340. #define ISC_SHOWUICANDIDATEWINDOW 0x00000001
  341. #define ISC_SHOWUICOMPOSITIONWINDOW 0x80000000
  342. #define ISC_SHOWUIGUIDELINE 0x40000000
  343. #define ISC_SHOWUIALLCANDIDATEWINDOW 0x0000000F
  344. #define ISC_SHOWUIALL 0xC000000F
  345. // dwIndex for ImmNotifyIME/NI_COMPOSITIONSTR
  346. #define CPS_COMPLETE 0x0001
  347. #define CPS_CONVERT 0x0002
  348. #define CPS_REVERT 0x0003
  349. #define CPS_CANCEL 0x0004
  350. // the modifiers of hot key
  351. #define MOD_ALT 0x0001
  352. #define MOD_CONTROL 0x0002
  353. #define MOD_SHIFT 0x0004
  354. #define MOD_LEFT 0x8000
  355. #define MOD_RIGHT 0x4000
  356. #define MOD_ON_KEYUP 0x0800
  357. #define MOD_IGNORE_ALL_MODIFIER 0x0400
  358. // Windows for Simplified Chinese Edition hot key ID from 0x10 - 0x2F
  359. #define IME_CHOTKEY_IME_NONIME_TOGGLE 0x10
  360. #define IME_CHOTKEY_SHAPE_TOGGLE 0x11
  361. #define IME_CHOTKEY_SYMBOL_TOGGLE 0x12
  362. // Windows for Japanese Edition hot key ID from 0x30 - 0x4F
  363. #define IME_JHOTKEY_CLOSE_OPEN 0x30
  364. // Windows for Korean Edition hot key ID from 0x50 - 0x6F
  365. #define IME_KHOTKEY_SHAPE_TOGGLE 0x50
  366. #define IME_KHOTKEY_HANJACONVERT 0x51
  367. #define IME_KHOTKEY_ENGLISH 0x52
  368. // Windows for Traditional Chinese Edition hot key ID from 0x70 - 0x8F
  369. #define IME_THOTKEY_IME_NONIME_TOGGLE 0x70
  370. #define IME_THOTKEY_SHAPE_TOGGLE 0x71
  371. #define IME_THOTKEY_SYMBOL_TOGGLE 0x72
  372. // direct switch hot key ID from 0x100 - 0x11F
  373. #define IME_HOTKEY_DSWITCH_FIRST 0x100
  374. #define IME_HOTKEY_DSWITCH_LAST 0x11F
  375. // IME private hot key from 0x200 - 0x21F
  376. #define IME_HOTKEY_PRIVATE_FIRST 0x200
  377. #define IME_ITHOTKEY_RESEND_RESULTSTR 0x200
  378. #define IME_ITHOTKEY_PREVIOUS_COMPOSITION 0x201
  379. #define IME_ITHOTKEY_UISTYLE_TOGGLE 0x202
  380. #define IME_ITHOTKEY_RECONVERTSTRING 0x203
  381. #define IME_HOTKEY_PRIVATE_LAST 0x21F
  382. // parameter of ImmGetCompositionString
  383. #define GCS_COMPREADSTR 0x0001
  384. #define GCS_COMPREADATTR 0x0002
  385. #define GCS_COMPREADCLAUSE 0x0004
  386. #define GCS_COMPSTR 0x0008
  387. #define GCS_COMPATTR 0x0010
  388. #define GCS_COMPCLAUSE 0x0020
  389. #define GCS_CURSORPOS 0x0080
  390. #define GCS_DELTASTART 0x0100
  391. #define GCS_RESULTREADSTR 0x0200
  392. #define GCS_RESULTREADCLAUSE 0x0400
  393. #define GCS_RESULTSTR 0x0800
  394. #define GCS_RESULTCLAUSE 0x1000
  395. // style bit flags for WM_IME_COMPOSITION
  396. #define CS_INSERTCHAR 0x2000
  397. #define CS_NOMOVECARET 0x4000
  398. // IME version constants
  399. #define IMEVER_0310 0x0003000A
  400. #define IMEVER_0400 0x00040000
  401. // IME property bits
  402. #define IME_PROP_AT_CARET 0x00010000
  403. #define IME_PROP_SPECIAL_UI 0x00020000
  404. #define IME_PROP_CANDLIST_START_FROM_1 0x00040000
  405. #define IME_PROP_UNICODE 0x00080000
  406. #define IME_PROP_COMPLETE_ON_UNSELECT 0x00100000
  407. // IME UICapability bits
  408. #define UI_CAP_2700 0x00000001
  409. #define UI_CAP_ROT90 0x00000002
  410. #define UI_CAP_ROTANY 0x00000004
  411. // ImmSetCompositionString Capability bits
  412. #define SCS_CAP_COMPSTR 0x00000001
  413. #define SCS_CAP_MAKEREAD 0x00000002
  414. #define SCS_CAP_SETRECONVERTSTRING 0x00000004
  415. // IME WM_IME_SELECT inheritance Capability bits
  416. #define SELECT_CAP_CONVERSION 0x00000001
  417. #define SELECT_CAP_SENTENCE 0x00000002
  418. // ID for deIndex of ImmGetGuideLine
  419. #define GGL_LEVEL 0x00000001
  420. #define GGL_INDEX 0x00000002
  421. #define GGL_STRING 0x00000003
  422. #define GGL_PRIVATE 0x00000004
  423. // ID for dwLevel of GUIDELINE Structure
  424. #define GL_LEVEL_NOGUIDELINE 0x00000000
  425. #define GL_LEVEL_FATAL 0x00000001
  426. #define GL_LEVEL_ERROR 0x00000002
  427. #define GL_LEVEL_WARNING 0x00000003
  428. #define GL_LEVEL_INFORMATION 0x00000004
  429. // ID for dwIndex of GUIDELINE Structure
  430. #define GL_ID_UNKNOWN 0x00000000
  431. #define GL_ID_NOMODULE 0x00000001
  432. #define GL_ID_NODICTIONARY 0x00000010
  433. #define GL_ID_CANNOTSAVE 0x00000011
  434. #define GL_ID_NOCONVERT 0x00000020
  435. #define GL_ID_TYPINGERROR 0x00000021
  436. #define GL_ID_TOOMANYSTROKE 0x00000022
  437. #define GL_ID_READINGCONFLICT 0x00000023
  438. #define GL_ID_INPUTREADING 0x00000024
  439. #define GL_ID_INPUTRADICAL 0x00000025
  440. #define GL_ID_INPUTCODE 0x00000026
  441. #define GL_ID_INPUTSYMBOL 0x00000027
  442. #define GL_ID_CHOOSECANDIDATE 0x00000028
  443. #define GL_ID_REVERSECONVERSION 0x00000029
  444. #define GL_ID_PRIVATE_FIRST 0x00008000
  445. #define GL_ID_PRIVATE_LAST 0x0000FFFF
  446. // ID for dwIndex of ImmGetProperty
  447. #define IGP_GETIMEVERSION (DWORD)(-4)
  448. #define IGP_PROPERTY 0x00000004
  449. #define IGP_CONVERSION 0x00000008
  450. #define IGP_SENTENCE 0x0000000c
  451. #define IGP_UI 0x00000010
  452. #define IGP_SETCOMPSTR 0x00000014
  453. #define IGP_SELECT 0x00000018
  454. // dwIndex for ImmSetCompositionString API
  455. #define SCS_SETSTR (GCS_COMPREADSTR|GCS_COMPSTR)
  456. #define SCS_CHANGEATTR (GCS_COMPREADATTR|GCS_COMPATTR)
  457. #define SCS_CHANGECLAUSE (GCS_COMPREADCLAUSE|GCS_COMPCLAUSE)
  458. #define SCS_SETRECONVERTSTRING 0x00010000
  459. #define SCS_QUERYRECONVERTSTRING 0x00020000
  460. // attribute for COMPOSITIONSTRING Structure
  461. #define ATTR_INPUT 0x00
  462. #define ATTR_TARGET_CONVERTED 0x01
  463. #define ATTR_CONVERTED 0x02
  464. #define ATTR_TARGET_NOTCONVERTED 0x03
  465. #define ATTR_INPUT_ERROR 0x04
  466. #define ATTR_FIXEDCONVERTED 0x05
  467. // bit field for IMC_SETCOMPOSITIONWINDOW, IMC_SETCANDIDATEWINDOW
  468. #define CFS_DEFAULT 0x0000
  469. #define CFS_RECT 0x0001
  470. #define CFS_POINT 0x0002
  471. #define CFS_FORCE_POSITION 0x0020
  472. #define CFS_CANDIDATEPOS 0x0040
  473. #define CFS_EXCLUDE 0x0080
  474. // conversion direction for ImmGetConversionList
  475. #define GCL_CONVERSION 0x0001
  476. #define GCL_REVERSECONVERSION 0x0002
  477. #define GCL_REVERSE_LENGTH 0x0003
  478. // bit field for conversion mode
  479. #define IME_CMODE_ALPHANUMERIC 0x0000
  480. #define IME_CMODE_NATIVE 0x0001
  481. #define IME_CMODE_CHINESE IME_CMODE_NATIVE
  482. // IME_CMODE_HANGEUL is old name of IME_CMODE_HANGUL. It will be gone eventually.
  483. #define IME_CMODE_HANGEUL IME_CMODE_NATIVE
  484. #define IME_CMODE_HANGUL IME_CMODE_NATIVE
  485. #define IME_CMODE_JAPANESE IME_CMODE_NATIVE
  486. #define IME_CMODE_KATAKANA 0x0002 // only effect under IME_CMODE_NATIVE
  487. #define IME_CMODE_LANGUAGE 0x0003
  488. #define IME_CMODE_FULLSHAPE 0x0008
  489. #define IME_CMODE_ROMAN 0x0010
  490. #define IME_CMODE_CHARCODE 0x0020
  491. #define IME_CMODE_HANJACONVERT 0x0040
  492. #define IME_CMODE_SOFTKBD 0x0080
  493. #define IME_CMODE_NOCONVERSION 0x0100
  494. #define IME_CMODE_EUDC 0x0200
  495. #define IME_CMODE_SYMBOL 0x0400
  496. #define IME_CMODE_FIXED 0x0800
  497. #define IME_CMODE_RESERVED 0xF0000000
  498. // bit field for sentence mode
  499. #define IME_SMODE_NONE 0x0000
  500. #define IME_SMODE_PLAURALCLAUSE 0x0001
  501. #define IME_SMODE_SINGLECONVERT 0x0002
  502. #define IME_SMODE_AUTOMATIC 0x0004
  503. #define IME_SMODE_PHRASEPREDICT 0x0008
  504. #define IME_SMODE_CONVERSATION 0x0010
  505. #define IME_SMODE_RESERVED 0x0000F000
  506. // style of candidate
  507. #define IME_CAND_UNKNOWN 0x0000
  508. #define IME_CAND_READ 0x0001
  509. #define IME_CAND_CODE 0x0002
  510. #define IME_CAND_MEANING 0x0003
  511. #define IME_CAND_RADICAL 0x0004
  512. #define IME_CAND_STROKE 0x0005
  513. // wParam of report message WM_IME_NOTIFY
  514. #define IMN_CLOSESTATUSWINDOW 0x0001
  515. #define IMN_OPENSTATUSWINDOW 0x0002
  516. #define IMN_CHANGECANDIDATE 0x0003
  517. #define IMN_CLOSECANDIDATE 0x0004
  518. #define IMN_OPENCANDIDATE 0x0005
  519. #define IMN_SETCONVERSIONMODE 0x0006
  520. #define IMN_SETSENTENCEMODE 0x0007
  521. #define IMN_SETOPENSTATUS 0x0008
  522. #define IMN_SETCANDIDATEPOS 0x0009
  523. #define IMN_SETCOMPOSITIONFONT 0x000A
  524. #define IMN_SETCOMPOSITIONWINDOW 0x000B
  525. #define IMN_SETSTATUSWINDOWPOS 0x000C
  526. #define IMN_GUIDELINE 0x000D
  527. #define IMN_PRIVATE 0x000E
  528. #if (WINVER >= 0x040A)
  529. // wParam of report message WM_IME_REQUEST
  530. #define IMR_COMPOSITIONWINDOW 0x0001
  531. #define IMR_CANDIDATEWINDOW 0x0002
  532. #define IMR_COMPOSITIONFONT 0x0003
  533. #define IMR_RECONVERTSTRING 0x0004
  534. #define IMR_CONFIRMRECONVERTSTRING 0x0005
  535. #define IMR_QUERYCHARPOSITION 0x0006
  536. #define IMR_DOCUMENTFEED 0x0007
  537. #endif /* WINVER >= 0x040A */
  538. // error code of ImmGetCompositionString
  539. #define IMM_ERROR_NODATA (-1)
  540. #define IMM_ERROR_GENERAL (-2)
  541. // dialog mode of ImmConfigureIME
  542. #define IME_CONFIG_GENERAL 1
  543. #define IME_CONFIG_REGISTERWORD 2
  544. #define IME_CONFIG_SELECTDICTIONARY 3
  545. // flags for ImmEscape
  546. #define IME_ESC_QUERY_SUPPORT 0x0003
  547. #define IME_ESC_RESERVED_FIRST 0x0004
  548. #define IME_ESC_RESERVED_LAST 0x07FF
  549. #define IME_ESC_PRIVATE_FIRST 0x0800
  550. #define IME_ESC_PRIVATE_LAST 0x0FFF
  551. #define IME_ESC_SEQUENCE_TO_INTERNAL 0x1001
  552. #define IME_ESC_GET_EUDC_DICTIONARY 0x1003
  553. #define IME_ESC_SET_EUDC_DICTIONARY 0x1004
  554. #define IME_ESC_MAX_KEY 0x1005
  555. #define IME_ESC_IME_NAME 0x1006
  556. #define IME_ESC_SYNC_HOTKEY 0x1007
  557. #define IME_ESC_HANJA_MODE 0x1008
  558. #define IME_ESC_AUTOMATA 0x1009
  559. #define IME_ESC_PRIVATE_HOTKEY 0x100a
  560. #define IME_ESC_GETHELPFILENAME 0x100b
  561. // style of word registration
  562. #define IME_REGWORD_STYLE_EUDC 0x00000001
  563. #define IME_REGWORD_STYLE_USER_FIRST 0x80000000
  564. #define IME_REGWORD_STYLE_USER_LAST 0xFFFFFFFF
  565. #if (WINVER >= 0x040A)
  566. // dwFlags for ImmAssociateContextEx
  567. #define IACE_CHILDREN 0x0001
  568. #define IACE_DEFAULT 0x0010
  569. #define IACE_IGNORENOCONTEXT 0x0020
  570. // dwFlags for ImmGetImeMenuItems
  571. #define IGIMIF_RIGHTMENU 0x0001
  572. // dwType for ImmGetImeMenuItems
  573. #define IGIMII_CMODE 0x0001
  574. #define IGIMII_SMODE 0x0002
  575. #define IGIMII_CONFIGURE 0x0004
  576. #define IGIMII_TOOLS 0x0008
  577. #define IGIMII_HELP 0x0010
  578. #define IGIMII_OTHER 0x0020
  579. #define IGIMII_INPUTTOOLS 0x0040
  580. // fType of IMEMENUITEMINFO structure
  581. #define IMFT_RADIOCHECK 0x00001
  582. #define IMFT_SEPARATOR 0x00002
  583. #define IMFT_SUBMENU 0x00004
  584. // fState of IMEMENUITEMINFO structure
  585. #define IMFS_GRAYED MFS_GRAYED
  586. #define IMFS_DISABLED MFS_DISABLED
  587. #define IMFS_CHECKED MFS_CHECKED
  588. #define IMFS_HILITE MFS_HILITE
  589. #define IMFS_ENABLED MFS_ENABLED
  590. #define IMFS_UNCHECKED MFS_UNCHECKED
  591. #define IMFS_UNHILITE MFS_UNHILITE
  592. #define IMFS_DEFAULT MFS_DEFAULT
  593. #endif /* WINVER >= 0x040A */
  594. // type of soft keyboard
  595. // for Windows Tranditional Chinese Edition
  596. #define SOFTKEYBOARD_TYPE_T1 0x0001
  597. // for Windows Simplified Chinese Edition
  598. #define SOFTKEYBOARD_TYPE_C1 0x0002
  599. #endif // _IMM_SDK_DEFINED_
  600. #ifndef _IMM_DDK_DEFINED_
  601. #define _IMM_DDK_DEFINED_
  602. typedef struct tagCOMPOSITIONSTRING {
  603. DWORD dwSize;
  604. DWORD dwCompReadAttrLen;
  605. DWORD dwCompReadAttrOffset;
  606. DWORD dwCompReadClauseLen;
  607. DWORD dwCompReadClauseOffset;
  608. DWORD dwCompReadStrLen;
  609. DWORD dwCompReadStrOffset;
  610. DWORD dwCompAttrLen;
  611. DWORD dwCompAttrOffset;
  612. DWORD dwCompClauseLen;
  613. DWORD dwCompClauseOffset;
  614. DWORD dwCompStrLen;
  615. DWORD dwCompStrOffset;
  616. DWORD dwCursorPos;
  617. DWORD dwDeltaStart;
  618. DWORD dwResultReadClauseLen;
  619. DWORD dwResultReadClauseOffset;
  620. DWORD dwResultReadStrLen;
  621. DWORD dwResultReadStrOffset;
  622. DWORD dwResultClauseLen;
  623. DWORD dwResultClauseOffset;
  624. DWORD dwResultStrLen;
  625. DWORD dwResultStrOffset;
  626. DWORD dwPrivateSize;
  627. DWORD dwPrivateOffset;
  628. } COMPOSITIONSTRING, *PCOMPOSITIONSTRING, NEAR *NPCOMPOSITIONSTRING, FAR *LPCOMPOSITIONSTRING;
  629. typedef struct tagGUIDELINE {
  630. DWORD dwSize;
  631. DWORD dwLevel;
  632. DWORD dwIndex;
  633. DWORD dwStrLen;
  634. DWORD dwStrOffset;
  635. DWORD dwPrivateSize;
  636. DWORD dwPrivateOffset;
  637. } GUIDELINE, *PGUIDELINE, NEAR *NPGUIDELINE, FAR *LPGUIDELINE;
  638. #if (WINVER >= 0x040A)
  639. typedef struct tagTRANSMSG {
  640. UINT message;
  641. WPARAM wParam;
  642. LPARAM lParam;
  643. } TRANSMSG, *PTRANSMSG, NEAR *NPTRANSMSG, FAR *LPTRANSMSG;
  644. typedef struct tagTRANSMSGLIST {
  645. UINT uMsgCount;
  646. TRANSMSG TransMsg[1];
  647. } TRANSMSGLIST, *PTRANSMSGLIST, NEAR *NPTRANSMSGLIST, FAR *LPTRANSMSGLIST;
  648. #endif /* WINVER >= 0x040A */
  649. typedef struct tagCANDIDATEINFO {
  650. DWORD dwSize;
  651. DWORD dwCount;
  652. DWORD dwOffset[32];
  653. DWORD dwPrivateSize;
  654. DWORD dwPrivateOffset;
  655. } CANDIDATEINFO, *PCANDIDATEINFO, NEAR *NPCANDIDATEINFO, FAR *LPCANDIDATEINFO;
  656. typedef struct tagIMEINFO {
  657. DWORD dwPrivateDataSize;
  658. DWORD fdwProperty;
  659. DWORD fdwConversionCaps;
  660. DWORD fdwSentenceCaps;
  661. DWORD fdwUICaps;
  662. DWORD fdwSCSCaps;
  663. DWORD fdwSelectCaps;
  664. } IMEINFO, *PIMEINFO, NEAR *NPIMEINFO, FAR *LPIMEINFO;
  665. typedef struct tagSOFTKBDDATA {
  666. UINT uCount;
  667. WORD wCode[1][256];
  668. } SOFTKBDDATA, *PSOFTKBDDATA, NEAR *NPSOFTKBDDATA, FAR * LPSOFTKBDDATA;
  669. BOOL WINAPI ImmGetHotKey(IN DWORD, OUT LPUINT lpuModifiers, OUT LPUINT lpuVKey, OUT LPHKL);
  670. BOOL WINAPI ImmSetHotKey(IN DWORD, IN UINT, IN UINT, IN HKL);
  671. BOOL WINAPI ImmGenerateMessage(IN HIMC);
  672. #if (WINVER >= 0x040A)
  673. LRESULT WINAPI ImmRequestMessageA(IN HIMC, IN WPARAM, IN LPARAM);
  674. LRESULT WINAPI ImmRequestMessageW(IN HIMC, IN WPARAM, IN LPARAM);
  675. #ifdef UNICODE
  676. #define ImmRequestMessage ImmRequestMessageW
  677. #else
  678. #define ImmRequestMessage ImmRequestMessageA
  679. #endif // !UNICODE
  680. #endif /* WINVER >= 0x040A */
  681. //
  682. // Prototype of soft keyboard APIs
  683. //
  684. HWND WINAPI ImmCreateSoftKeyboard(IN UINT, IN HWND, IN int, IN int);
  685. BOOL WINAPI ImmDestroySoftKeyboard(IN HWND);
  686. BOOL WINAPI ImmShowSoftKeyboard(IN HWND, IN int);
  687. BOOL WINAPI ImmUnlockIMC(IN HIMC);
  688. DWORD WINAPI ImmGetIMCLockCount(IN HIMC);
  689. HIMCC WINAPI ImmCreateIMCC(IN DWORD);
  690. HIMCC WINAPI ImmDestroyIMCC(IN HIMCC);
  691. LPVOID WINAPI ImmLockIMCC(IN HIMCC);
  692. BOOL WINAPI ImmUnlockIMCC(IN HIMCC);
  693. DWORD WINAPI ImmGetIMCCLockCount(IN HIMCC);
  694. HIMCC WINAPI ImmReSizeIMCC(IN HIMCC, IN DWORD);
  695. DWORD WINAPI ImmGetIMCCSize(IN HIMCC);
  696. // the window extra offset
  697. #define IMMGWL_IMC 0
  698. #define IMMGWL_PRIVATE (sizeof(LONG))
  699. #ifdef _WIN64
  700. #undef IMMGWL_IMC
  701. #undef IMMGWL_PRIVATE
  702. #endif /* _WIN64 */
  703. #define IMMGWLP_IMC 0
  704. #define IMMGWLP_PRIVATE (sizeof(LONG_PTR))
  705. // for NI_CONTEXTUPDATED
  706. #define IMC_SETCONVERSIONMODE 0x0002
  707. #define IMC_SETSENTENCEMODE 0x0004
  708. #define IMC_SETOPENSTATUS 0x0006
  709. // wParam for WM_IME_CONTROL to the soft keyboard
  710. #define IMC_GETSOFTKBDFONT 0x0011
  711. #define IMC_SETSOFTKBDFONT 0x0012
  712. #define IMC_GETSOFTKBDPOS 0x0013
  713. #define IMC_SETSOFTKBDPOS 0x0014
  714. #define IMC_GETSOFTKBDSUBTYPE 0x0015
  715. #define IMC_SETSOFTKBDSUBTYPE 0x0016
  716. #define IMC_SETSOFTKBDDATA 0x0018
  717. // dwAction for ImmNotifyIME
  718. #define NI_CONTEXTUPDATED 0x0003
  719. // dwSystemInfoFlags bits
  720. #define IME_SYSINFO_WINLOGON 0x0001
  721. #define IME_SYSINFO_WOW16 0x0002
  722. #define GCS_COMP (GCS_COMPSTR|GCS_COMPATTR|GCS_COMPCLAUSE)
  723. #define GCS_COMPREAD (GCS_COMPREADSTR|GCS_COMPREADATTR |GCS_COMPREADCLAUSE)
  724. #define GCS_RESULT (GCS_RESULTSTR|GCS_RESULTCLAUSE)
  725. #define GCS_RESULTREAD (GCS_RESULTREADSTR|GCS_RESULTREADCLAUSE)
  726. // bits of fdwInit of INPUTCONTEXT
  727. #define INIT_STATUSWNDPOS 0x00000001
  728. #define INIT_CONVERSION 0x00000002
  729. #define INIT_SENTENCE 0x00000004
  730. #define INIT_LOGFONT 0x00000008
  731. #define INIT_COMPFORM 0x00000010
  732. #define INIT_SOFTKBDPOS 0x00000020
  733. // IME property bits
  734. #define IME_PROP_END_UNLOAD 0x00000001
  735. #define IME_PROP_KBD_CHAR_FIRST 0x00000002
  736. #define IME_PROP_IGNORE_UPKEYS 0x00000004
  737. #define IME_PROP_NEED_ALTKEY 0x00000008
  738. #define IME_PROP_NO_KEYS_ON_CLOSE 0x00000010
  739. #define IME_PROP_ACCEPT_WIDE_VKEY 0x00000020
  740. // IME UICapability bits
  741. #define UI_CAP_SOFTKBD 0x00010000
  742. #define IMN_SOFTKBDDESTROYED 0x0011
  743. // flags for ImmEscape
  744. // prototype of IME APIs
  745. BOOL WINAPI ImeInquire(IN LPIMEINFO, OUT LPTSTR lpszUIClass, IN DWORD dwSystemInfoFlags);
  746. BOOL WINAPI ImeConfigure(IN HKL, IN HWND, IN DWORD, IN LPVOID);
  747. DWORD WINAPI ImeConversionList(HIMC, LPCTSTR, LPCANDIDATELIST, DWORD dwBufLen, UINT uFlag);
  748. BOOL WINAPI ImeDestroy(UINT);
  749. LRESULT WINAPI ImeEscape(HIMC, UINT, LPVOID);
  750. BOOL WINAPI ImeProcessKey(IN HIMC, IN UINT, IN LPARAM, IN CONST LPBYTE);
  751. BOOL WINAPI ImeSelect(IN HIMC, IN BOOL);
  752. BOOL WINAPI ImeSetActiveContext(IN HIMC, IN BOOL);
  753. #if (WINVER >= 0x040A)
  754. UINT WINAPI ImeToAsciiEx(IN UINT uVirtKey, IN UINT uScaCode, IN CONST LPBYTE lpbKeyState, OUT LPTRANSMSGLIST lpTransBuf, IN UINT fuState, IN HIMC);
  755. #else
  756. UINT WINAPI ImeToAsciiEx(IN UINT uVirtKey, IN UINT uScaCode, IN CONST LPBYTE lpbKeyState, OUT LPDWORD lpdwTransBuf, IN UINT fuState, IN HIMC);
  757. #endif /* WINVER >= 0x040A */
  758. BOOL WINAPI NotifyIME(IN HIMC, IN DWORD, IN DWORD, IN DWORD);
  759. BOOL WINAPI ImeRegisterWord(IN LPCTSTR, IN DWORD, IN LPCTSTR);
  760. BOOL WINAPI ImeUnregisterWord(IN LPCTSTR, IN DWORD, IN LPCTSTR);
  761. UINT WINAPI ImeGetRegisterWordStyle(IN UINT nItem, OUT LPSTYLEBUF);
  762. UINT WINAPI ImeEnumRegisterWord(IN REGISTERWORDENUMPROC, IN LPCTSTR, IN DWORD, IN LPCTSTR, IN LPVOID);
  763. BOOL WINAPI ImeSetCompositionString(IN HIMC, IN DWORD dwIndex, IN LPVOID lpComp, IN DWORD, IN LPVOID lpRead, IN DWORD);
  764. #endif // _IMM_DDK_DEFINED_
  765. #if defined(_WINGDI_) && !defined(NOGDI)
  766. typedef struct tagINPUTCONTEXT {
  767. HWND hWnd;
  768. BOOL fOpen;
  769. POINT ptStatusWndPos;
  770. POINT ptSoftKbdPos;
  771. DWORD fdwConversion;
  772. DWORD fdwSentence;
  773. union {
  774. LOGFONTA A;
  775. LOGFONTW W;
  776. } lfFont;
  777. COMPOSITIONFORM cfCompForm;
  778. CANDIDATEFORM cfCandForm[4];
  779. HIMCC hCompStr;
  780. HIMCC hCandInfo;
  781. HIMCC hGuideLine;
  782. HIMCC hPrivate;
  783. DWORD dwNumMsgBuf;
  784. HIMCC hMsgBuf;
  785. DWORD fdwInit;
  786. DWORD dwReserve[3];
  787. UINT uSavedVKey;
  788. BOOL fChgMsg;
  789. DWORD fdwFlags;
  790. DWORD fdw31Compat;
  791. DWORD dwRefCount;
  792. PVOID pImeModeSaver;
  793. DWORD fdwDirty;
  794. #ifdef CUAS_ENABLE
  795. HIMCC hCtfImeContext;
  796. #endif // CUAS_ENABLE
  797. } INPUTCONTEXT, *PINPUTCONTEXT, NEAR *NPINPUTCONTEXT, FAR *LPINPUTCONTEXT;
  798. #endif
  799. #ifdef CUAS_ENABLE
  800. /////////////////////////////////////////////////////////////////////////////
  801. // GUID attribute (IME share)
  802. // COMPOSITIONSTRING->dwPrivateSize = sizeof(GUIDMAPATTRIBUTE) + actual data array.
  803. // GUIDMAPATTRIBUTE* = GetOffset(COMPOSITIONSTRING->dwPrivateOffset)
  804. typedef struct tagGUIDMAPATTRIBUTE {
  805. //
  806. // IME share of GUID map attribute.
  807. //
  808. DWORD dwTfGuidAtomLen;
  809. DWORD dwTfGuidAtomOffset; // Offset based on GUIDMAPATTRIBUTE struct.
  810. //
  811. DWORD dwGuidMapAttrLen;
  812. DWORD dwGuidMapAttrOffset; // Offset based on GUIDMAPATTRIBUTE struct.
  813. } GUIDMAPATTRIBUTE, *PGUIDMAPATTRIBUTE;
  814. #endif // CUAS_ENABLE
  815. #if defined(_WINGDI_) && !defined(NOGDI)
  816. LPINPUTCONTEXT WINAPI ImmLockIMC(IN HIMC);
  817. #endif
  818. #if (WINVER >= 0x040A)
  819. #ifdef CUAS_ENABLE
  820. //
  821. // Prototype of Cicero Unaware
  822. //
  823. HRESULT WINAPI CtfImmGetGuidAtom(IN HIMC, IN BYTE, OUT DWORD*);
  824. BOOL WINAPI CtfImmIsGuidMapEnable(IN HIMC);
  825. BOOL WINAPI CtfImmIsCiceroEnabled();
  826. BOOL WINAPI CtfImmIsTextFrameServiceDisabled();
  827. BOOL WINAPI CtfImmIsCiceroStartedInThread();
  828. HRESULT WINAPI CtfImmSetCiceroStartInThread(BOOL fSet);
  829. UINT WINAPI GetKeyboardLayoutCP(HKL hKL);
  830. DWORD WINAPI ImmGetAppCompatFlags(HIMC hIMC);
  831. VOID WINAPI CtfImmSetAppCompatFlags(DWORD dwFlag);
  832. HRESULT WINAPI CtfAImmActivate(HMODULE* phMod);
  833. HRESULT WINAPI CtfAImmDeactivate(HMODULE hMod);
  834. BOOL WINAPI CtfImmGenerateMessage(IN HIMC, BOOL fSendMsg);
  835. #endif // CUAS_ENABLE
  836. #endif /* WINVER >= 0x040A */
  837. // wParam for WM_IME_CONTROL
  838. #define IMC_FIRST 0x0000
  839. // 0x11 - 0x20 is reserved for soft keyboard
  840. #define IMC_LAST 0x0022
  841. // wParam for WM_IME_SYSTEM
  842. #define IMS_DESTROYWINDOW 0x0001
  843. #define IMS_IME31COMPATIBLE 0x0002
  844. #define IMS_SETOPENSTATUS 0x0003
  845. #define IMS_SETACTIVECONTEXT 0x0004
  846. #define IMS_CHANGE_SHOWSTAT 0x0005
  847. #define IMS_WINDOWPOS 0x0006
  848. #define IMS_SENDIMEMSG 0x0007
  849. #define IMS_SENDIMEMSGEX 0x0008
  850. #define IMS_SETCANDIDATEPOS 0x0009
  851. #define IMS_SETCOMPOSITIONFONT 0x000A
  852. #define IMS_SETCOMPOSITIONWINDOW 0x000B
  853. #define IMS_CHECKENABLE 0x000C
  854. #define IMS_CONFIGUREIME 0x000D
  855. #define IMS_CONTROLIMEMSG 0x000E
  856. #define IMS_SETOPENCLOSE 0x000F
  857. #define IMS_ISACTIVATED 0x0010
  858. #define IMS_UNLOADTHREADLAYOUT 0x0011
  859. #define IMS_LCHGREQUEST 0x0012
  860. #define IMS_SETSOFTKBDONOFF 0x0013
  861. #define IMS_GETCONVERSIONMODE 0x0014
  862. #define IMS_IMEHELP 0x0015
  863. #define IMS_IMENT35SENDAPPMSG 0x0016
  864. #define IMS_ACTIVATECONTEXT 0x0017
  865. #define IMS_DEACTIVATECONTEXT 0x0018
  866. #define IMS_ACTIVATETHREADLAYOUT 0x0019
  867. #define IMS_CLOSEPROPERTYWINDOW 0x001a
  868. #define IMS_OPENPROPERTYWINDOW 0x001b
  869. #define IMS_GETIMEMENU 0x001c
  870. #define IMS_ENDIMEMENU 0x001d
  871. #define IMS_GETCONTEXT 0x001e
  872. #define IMS_SENDNOTIFICATION 0x001f
  873. // IMS_SENDNOTIFICATION dirty bits for INPUTCONTEXT
  874. #define IMSS_UPDATE_OPEN 0x0001
  875. #define IMSS_UPDATE_CONVERSION 0x0002
  876. #define IMSS_UPDATE_SENTENCE 0x0004
  877. #define IMSS_INIT_OPEN 0x0100
  878. #define IMS_FINALIZE_COMPSTR 0x0020
  879. #ifdef CUAS_ENABLE
  880. #define IMS_LOADTHREADLAYOUT 0x0021
  881. #define IMS_SETLANGBAND 0x0023
  882. #define IMS_RESETLANGBAND 0x0024
  883. #endif // CUAS_ENABLE
  884. // for NI_CONTEXTUPDATED
  885. #define IMC_GETCONVERSIONMODE 0x0001
  886. #define IMC_GETSENTENCEMODE 0x0003
  887. #define IMC_GETOPENSTATUS 0x0005
  888. // the return bits of ImmProcessHotKey
  889. #define IPHK_HOTKEY 0x0001
  890. #define IPHK_PROCESSBYIME 0x0002
  891. #define IPHK_CHECKCTRL 0x0004
  892. // NT only
  893. #define IPHK_SKIPTHISKEY 0x0010
  894. // the modifiers of hot key
  895. #define MOD_WIN 0x0008
  896. // IME Hotkeys internal definitions
  897. #define IME_CHOTKEY_FIRST 0x10
  898. #define IME_CHOTKEY_LAST 0x2f
  899. #define IME_JHOTKEY_FIRST 0x30
  900. #define IME_JHOTKEY_LAST 0x4f
  901. #define IME_KHOTKEY_FIRST 0x50
  902. #define IME_KHOTKEY_LAST 0x6f
  903. #define IME_THOTKEY_FIRST 0x70
  904. #define IME_THOTKEY_LAST 0x8f
  905. #define IME_INVALID_HOTKEY 0xffffffff
  906. #ifdef CUAS_ENABLE
  907. #define GCS_COMPGUIDATTR 0x8000
  908. #endif // CUAS_ENABLE
  909. #ifdef CUAS_ENABLE
  910. // bits of fdwInit of INPUTCONTEXT
  911. #define INIT_GUID_ATOM 0x00000040
  912. #endif // CUAS_ENABLE
  913. // fdw31Compat of INPUTCONTEXT
  914. #define F31COMPAT_NOKEYTOIME 0x00000001
  915. #define F31COMPAT_MCWHIDDEN 0x00000002
  916. #define F31COMPAT_MCWVERTICAL 0x00000004
  917. #define F31COMPAT_CALLFROMWINNLS 0x00000008
  918. #define F31COMPAT_SAVECTRL 0x00010000
  919. #define F31COMPAT_PROCESSEVENT 0x00020000
  920. #define F31COMPAT_ECSETCFS 0x00040000
  921. // the return value of ImmGetAppIMECompatFlags
  922. #define IMECOMPAT_UNSYNC31IMEMSG 0x00000001
  923. // the meaning of this bit depend on the same bit in
  924. // IMELinkHdr.ctCountry.fdFlags
  925. #define IMECOMPAT_DUMMYTASK 0x00000002
  926. // For Japanese and Hangeul versions, this bit on
  927. // indicates no dummy task is needed
  928. #define IMECOMPAT_NODUMMYTASK IMECOMPAT_DUMMYTASK
  929. // For Chinese and PRC versions, this bit on indicates
  930. // a dummy tasked is needed
  931. #define IMECOMPAT_NEEDDUMMYTASK IMECOMPAT_DUMMYTASK
  932. #define IMECOMPAT_POSTDUMMY 0x00000004
  933. #define IMECOMPAT_ECNOFLUSH 0x00000008
  934. #define IMECOMPAT_NOINPUTLANGCHGTODLG 0x00000010
  935. #define IMECOMPAT_ECREDRAWPARENT 0x00000020
  936. #define IMECOMPAT_SENDOLDSBM 0x00000040
  937. #define IMECOMPAT_UNSYNC31IMEMSG2 0x00000080
  938. #define IMECOMPAT_NOIMEMSGINTERTASK 0x00000100
  939. #define IMECOMPAT_USEXWANSUNG 0x00000200
  940. #define IMECOMPAT_JXWFORATOK 0x00000400
  941. #define IMECOMPAT_NOIME 0x00000800
  942. #define IMECOMPAT_NOKBDHOOK 0x00001000
  943. #define IMECOMPAT_APPWNDREMOVEIMEMSGS 0x00002000
  944. #define IMECOMPAT_LSTRCMP31COMPATIBLE 0x00004000
  945. #define IMECOMPAT_USEALTSTKFORSHLEXEC 0x00008000
  946. #define IMECOMPAT_NOVKPROCESSKEY 0x00010000
  947. #define IMECOMPAT_NOYIELDWMCHAR 0x00020000
  948. #define IMECOMPAT_SENDSC_RESTORE 0x00040000
  949. #define IMECOMPAT_NOSENDLANGCHG 0x00080000
  950. #define IMECOMPAT_FORCEUNSYNC31IMEMSG 0x00100000
  951. #define IMECOMPAT_CONSOLEIMEPROCESS 0x00200000
  952. //
  953. // KOR only: do not finalize the composition
  954. // string on mouse click
  955. //
  956. #define IMECOMPAT_NOFINALIZECOMPSTR 0x00400000
  957. //
  958. // Terminal Server Client (MSTSC.EXE) only:
  959. // If client machine connected Fujitsu Oasys keyboard, disable NlsKbdSendIMENotification call
  960. //
  961. #define IMECOMPAT_HYDRACLIENT 0x00800000
  962. #ifdef CUAS_ENABLE
  963. //
  964. // Cicero Unaware Support
  965. // per process information
  966. //
  967. #define IMECOMPAT_AIMM_LEGACY_CLSID 0x01000000
  968. #define IMECOMPAT_AIMM_TRIDENT55 0x02000000
  969. #define IMECOMPAT_AIMM12_TRIDENT 0x04000000
  970. #define IMECOMPAT_AIMM12 0x08000000
  971. #endif // CUAS_ENABLE
  972. #define IMGTF_CANT_SWITCH_LAYOUT 0x00000001
  973. #define IMGTF_CANT_UNLOAD_IME 0x00000002
  974. // all IME property bits, anyone add a new bit must update this !!!
  975. #define IME_PROP_ALL 0x001F003F
  976. // all IME UICapability bits, anyone add a new bit must update this !!!
  977. #define UI_CAP_ALL 0x00010007
  978. // ImmSetCompositionString Capability bits
  979. // all ImmSetCompositionString Capability bits !!!
  980. #define SCS_CAP_ALL 0x00000007
  981. // all IME WM_IME_SELECT inheritance Capability bits !!!
  982. #define SELECT_CAP_ALL 0x00000003
  983. // ID for dwIndex of ImmGetProperty
  984. // The value is the offset of IMEINFO structure
  985. // last property index, anyone add a new property index must update this !!!
  986. #define IGP_LAST IGP_SELECT
  987. // bit field for IMC_SETCOMPOSITIONWINDOW, IMC_SETCANDIDATEWINDOW
  988. #define CFS_SCREEN 0x0004
  989. #define CFS_VERTICAL 0x0008
  990. #define CFS_HIDDEN 0x0010
  991. // all conversion mode bits, anyone add a new bit must update this !!!
  992. #define IME_CMODE_ALL 0x0FFF
  993. //
  994. // This is extended NLS mode for console and console IME
  995. //
  996. #define IME_CMODE_OPEN 0x20000000
  997. #define IME_CMODE_DISABLE 0x40000000
  998. #ifdef CUAS_ENABLE
  999. // bit field for extended conversion mode
  1000. #define IME_CMODE_GUID_NULL 0x80000000
  1001. #endif // CUAS_ENABLE
  1002. // all sentence mode bits, anyone add a new bit must update this !!!
  1003. #define IME_SMODE_ALL 0x001F
  1004. #ifdef CUAS_ENABLE
  1005. // bit field for extended conversion mode
  1006. #define IME_SMODE_GUID_NULL 0x00008000
  1007. #endif // CUAS_ENABLE
  1008. #if (WINVER >= 0x040A)
  1009. #ifdef CUAS_ENABLE
  1010. // prototype of IME APIs for Cicero Bridge
  1011. HRESULT WINAPI CtfImeInquireEx(IN LPIMEINFO, OUT LPTSTR lpszUIClass, IN DWORD dwSystemInfoFlags, HKL hKL);
  1012. HRESULT WINAPI CtfImeCreateThreadMgr();
  1013. HRESULT WINAPI CtfImeDestroyThreadMgr();
  1014. HRESULT WINAPI CtfImeCreateInputContext(HIMC hImc);
  1015. HRESULT WINAPI CtfImeDestroyInputContext(HIMC hImc);
  1016. HRESULT WINAPI CtfImeSelectEx(HIMC hIMC, BOOL fSelect, HKL hKL);
  1017. HRESULT WINAPI CtfImeSetActiveContextAlways(HIMC hIMC, BOOL fOn, HWND hWnd, HKL hkl);
  1018. LRESULT WINAPI CtfImeEscapeEx(HIMC hIMC, UINT uSubFunc, LPVOID lpData, HKL hKL);
  1019. HRESULT WINAPI CtfImeGetGuidAtom(HIMC hIMC, BYTE bAttr, DWORD* pAtom);
  1020. BOOL WINAPI CtfImeIsGuidMapEnable(HIMC hIMC);
  1021. BOOL WINAPI CtfImeProcessCicHotkey(HIMC hIMC, UINT uVKey, LPARAM lParam);
  1022. #endif // CUAS_ENABLE
  1023. #endif /* WINVER >= 0x040A */
  1024. //
  1025. // nCode for MsctfCicNotify
  1026. //
  1027. #define CICN_LANGCHANGEHOTKEY 0x0001
  1028. #ifdef __cplusplus
  1029. }
  1030. #endif
  1031. #endif // _IMMP_