home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / MSINC.PAK / IMM.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  21KB  |  569 lines

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