home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / ime.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  7KB  |  239 lines

  1. /*++ BUILD Version: 0003    // Increment this if a change has global effects
  2.  
  3. Copyright (c) 1985-1997, Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     ime.h
  8.  
  9. Abstract:
  10.  
  11.     Procedure declarations, constant definitions and macros for the IME
  12.     component.
  13.  
  14. --*/
  15.  
  16. #ifndef _IME_
  17. #define _IME_
  18.  
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif /* __cplusplus */
  22.  
  23.  
  24. #ifndef _WINDEF_
  25. typedef unsigned int UINT;
  26. #endif // _WINDEF_
  27.  
  28. #define IME_MAXPROCESS 32
  29.  
  30. LRESULT WINAPI SendIMEMessageExA(HWND, LPARAM);
  31. LRESULT WINAPI SendIMEMessageExW(HWND, LPARAM);
  32. #ifdef UNICODE
  33. #define SendIMEMessageEx  SendIMEMessageExW
  34. #else
  35. #define SendIMEMessageEx  SendIMEMessageExA
  36. #endif // !UNICODE
  37.  
  38. //
  39. // IMESTRUCT structure for SendIMEMessageEx
  40. //
  41. typedef struct tagIMESTRUCT {
  42.     UINT     fnc;        // function code
  43.     WPARAM   wParam;     // word parameter
  44.     UINT     wCount;     // word counter
  45.     UINT     dchSource;  // offset to Source from top of memory object
  46.     UINT     dchDest;    // offset to Desrination from top of memory object
  47.     LPARAM   lParam1;
  48.     LPARAM   lParam2;
  49.     LPARAM   lParam3;
  50. } IMESTRUCT,*PIMESTRUCT,NEAR *NPIMESTRUCT,FAR *LPIMESTRUCT;
  51.  
  52.  
  53.  
  54. #define CP_HWND                 0
  55. #define CP_OPEN                 1
  56. #define CP_DIRECT               2
  57. #define CP_LEVEL                3
  58.  
  59.  
  60. //
  61. //      Virtual Keys
  62. //
  63.  
  64. #define VK_DBE_ALPHANUMERIC              0x0f0
  65. #define VK_DBE_KATAKANA                  0x0f1
  66. #define VK_DBE_HIRAGANA                  0x0f2
  67. #define VK_DBE_SBCSCHAR                  0x0f3
  68. #define VK_DBE_DBCSCHAR                  0x0f4
  69. #define VK_DBE_ROMAN                     0x0f5
  70. #define VK_DBE_NOROMAN                   0x0f6
  71. #define VK_DBE_ENTERWORDREGISTERMODE     0x0f7
  72. #define VK_DBE_ENTERIMECONFIGMODE        0x0f8
  73. #define VK_DBE_FLUSHSTRING               0x0f9
  74. #define VK_DBE_CODEINPUT                 0x0fa
  75. #define VK_DBE_NOCODEINPUT               0x0fb
  76. #define VK_DBE_DETERMINESTRING           0x0fc
  77. #define VK_DBE_ENTERDLGCONVERSIONMODE    0x0fd
  78.  
  79.  
  80.  
  81. //
  82. //     switch for wParam of IME_SETCONVERSIONWINDOW
  83. //
  84. #define MCW_DEFAULT             0x00
  85. #define MCW_RECT                0x01
  86. #define MCW_WINDOW              0x02
  87. #define MCW_SCREEN              0x04
  88. #define MCW_VERTICAL            0x08
  89. #define MCW_HIDDEN              0x10
  90.  
  91. //
  92. //    switch for wParam of IME_SETCONVERSIONMODE
  93. //       and IME_GETCONVERSIONMODE
  94. //
  95. #define IME_MODE_ALPHANUMERIC   0x0001
  96.  
  97. #ifdef KOREA    // BeomOh - 9/29/92
  98. #define IME_MODE_SBCSCHAR       0x0002
  99. #else
  100. #define IME_MODE_SBCSCHAR       0x0008
  101. #endif
  102.  
  103. #define IME_MODE_KATAKANA       0x0002
  104. #define IME_MODE_HIRAGANA       0x0004
  105. #define IME_MODE_HANJACONVERT   0x0004
  106. #define IME_MODE_DBCSCHAR       0x0010
  107. #define IME_MODE_ROMAN          0x0020
  108. #define IME_MODE_NOROMAN        0x0040
  109. #define IME_MODE_CODEINPUT      0x0080
  110. #define IME_MODE_NOCODEINPUT    0x0100
  111. //
  112. //
  113.  
  114. //
  115. //     IME APIs
  116. //
  117. #define IME_GETIMECAPS            0x03
  118. #define IME_SETOPEN               0x04
  119. #define IME_GETOPEN               0x05
  120. #define IME_GETVERSION            0x07
  121. #define IME_SETCONVERSIONWINDOW   0x08
  122. #define IME_MOVEIMEWINDOW         IME_SETCONVERSIONWINDOW       // KOREA only
  123. #define IME_SETCONVERSIONMODE     0x10
  124.  
  125. #define IME_GETCONVERSIONMODE     0x11
  126. #define IME_SET_MODE              0x12          // KOREA only
  127. #define IME_SENDVKEY              0x13
  128. #define IME_ENTERWORDREGISTERMODE 0x18
  129. #define IME_SETCONVERSIONFONTEX   0x19
  130.  
  131. //
  132. // IME_CODECONVERT subfunctions
  133. //
  134. #define IME_BANJAtoJUNJA        0x13            // KOREA only
  135. #define IME_JUNJAtoBANJA        0x14            // KOREA only
  136. #define IME_JOHABtoKS           0x15            // KOREA only
  137. #define IME_KStoJOHAB           0x16            // KOREA only
  138.  
  139. //
  140. // IME_AUTOMATA subfunctions
  141. //
  142. #define IMEA_INIT               0x01            // KOREA only
  143. #define IMEA_NEXT               0x02            // KOREA only
  144. #define IMEA_PREV               0x03            // KOREA only
  145.  
  146. //
  147. // IME_HANJAMODE subfunctions
  148. //
  149. #define IME_REQUEST_CONVERT     0x01            // KOREA only
  150. #define IME_ENABLE_CONVERT      0x02            // KOREA only
  151.  
  152. //
  153. // IME_MOVEIMEWINDOW subfunctions
  154. //
  155. #define INTERIM_WINDOW          0x00            // KOREA only
  156. #define MODE_WINDOW             0x01            // KOREA only
  157. #define HANJA_WINDOW            0x02            // KOREA only
  158.  
  159. //
  160. //    error code
  161. //
  162. #define IME_RS_ERROR            0x01    // genetal error
  163. #define IME_RS_NOIME            0x02    // IME is not installed
  164. #define IME_RS_TOOLONG          0x05    // given string is too long
  165. #define IME_RS_ILLEGAL          0x06    // illegal charactor(s) is string
  166. #define IME_RS_NOTFOUND         0x07    // no (more) candidate
  167. #define IME_RS_NOROOM           0x0a    // no disk/memory space
  168. #define IME_RS_DISKERROR        0x0e    // disk I/O error
  169. #define IME_RS_INVALID          0x11    // Win3.1/NT
  170. #define IME_RS_NEST             0x12    // called nested
  171. #define IME_RS_SYSTEMMODAL      0x13    // called when system mode
  172.  
  173. //
  174. //   report messge from IME to WinApps
  175. //
  176. #define WM_IME_REPORT       0x0280
  177.  
  178. //
  179. //   report message parameter for WM_IME_REPORT
  180. //
  181. #define IR_STRINGSTART      0x100
  182. #define IR_STRINGEND        0x101
  183. #define IR_OPENCONVERT      0x120
  184. #define IR_CHANGECONVERT    0x121
  185. #define IR_CLOSECONVERT     0x122
  186. #define IR_FULLCONVERT      0x123
  187. #define IR_IMESELECT        0x130
  188. #define IR_STRING       0x140
  189. #define IR_DBCSCHAR             0x160
  190. #define IR_UNDETERMINE          0x170
  191. #define IR_STRINGEX             0x180   // New for 3.1
  192. #define IR_MODEINFO             0x190
  193.  
  194. //#define WM_CONVERTREQUESTEX     0x0109
  195. #define WM_WNT_CONVERTREQUESTEX 0x0109 /* WM_CONVERTREQUESTEX: 109 for NT, 108 for OT */
  196. #define WM_CONVERTREQUEST       0x010A
  197. #define WM_CONVERTRESULT        0x010B
  198. #define WM_INTERIM              0x010C
  199.  
  200. #define WM_IMEKEYDOWN           0x290
  201. #define WM_IMEKEYUP             0x291
  202.  
  203.  
  204. //
  205. // UNDETERMINESTRING structure for IR_UNDETERMINE
  206. //
  207. typedef struct tagUNDETERMINESTRUCT {
  208.     DWORD    dwSize;
  209.     UINT     uDefIMESize;
  210.     UINT     uDefIMEPos;
  211.     UINT     uUndetTextLen;
  212.     UINT     uUndetTextPos;
  213.     UINT     uUndetAttrPos;
  214.     UINT     uCursorPos;
  215.     UINT     uDeltaStart;
  216.     UINT     uDetermineTextLen;
  217.     UINT     uDetermineTextPos;
  218.     UINT     uDetermineDelimPos;
  219.     UINT     uYomiTextLen;
  220.     UINT     uYomiTextPos;
  221.     UINT     uYomiDelimPos;
  222. } UNDETERMINESTRUCT,*PUNDETERMINESTRUCT,NEAR *NPUNDETERMINESTRUCT,FAR *LPUNDETERMINESTRUCT;
  223.  
  224.  
  225. typedef struct tagSTRINGEXSTRUCT {
  226.     DWORD    dwSize;
  227.     UINT     uDeterminePos;
  228.     UINT     uDetermineDelimPos;
  229.     UINT     uYomiPos;
  230.     UINT     uYomiDelimPos;
  231. } STRINGEXSTRUCT,NEAR *NPSTRINGEXSTRUCT,FAR *LPSTRINGEXSTRUCT;
  232.  
  233. #ifdef __cplusplus
  234. }
  235. #endif  /* __cplusplus */
  236.  
  237. #endif // _IME_
  238.  
  239.