home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / IME.H < prev    next >
C/C++ Source or Header  |  1997-01-16  |  8KB  |  295 lines

  1. /*++ BUILD Version: 0003    // Increment this if a change has global effects
  2.  
  3. Copyright (c) 1985-1996, 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. #ifdef __BORLANDC__
  24.   #include <pshpack8.h>
  25. #endif
  26.  
  27. #ifndef _WINDEF_
  28. typedef unsigned int UINT;
  29. #endif // _WINDEF_
  30.  
  31. #define IME_MAXPROCESS 32
  32.  
  33. LRESULT WINAPI SendIMEMessageExA(HWND, LPARAM);
  34. LRESULT WINAPI SendIMEMessageExW(HWND, LPARAM);
  35. #ifdef UNICODE
  36. #define SendIMEMessageEx  SendIMEMessageExW
  37. #else
  38. #define SendIMEMessageEx  SendIMEMessageExA
  39. #endif // !UNICODE
  40.  
  41. //
  42. // IMESTRUCT structure for SendIMEMessageEx
  43. //
  44. typedef struct tagIMESTRUCT {
  45.     UINT     fnc;        // function code
  46.     WPARAM   wParam;     // word parameter
  47.     UINT     wCount;     // word counter
  48.     UINT     dchSource;  // offset to Source from top of memory object
  49.     UINT     dchDest;    // offset to Desrination from top of memory object
  50.     LPARAM   lParam1;
  51.     LPARAM   lParam2;
  52.     LPARAM   lParam3;
  53. } IMESTRUCT,*PIMESTRUCT,NEAR *NPIMESTRUCT,FAR *LPIMESTRUCT;
  54.  
  55.  
  56.  
  57. #ifdef KOREA     // BeomOh - 10/05/92
  58. #define CP_HWND                 0
  59. #define CP_OPEN                 1
  60. #define CP_DIRECT               2
  61. #define CP_LEVEL                3
  62.  
  63. #define lpSource(lpks) (LPSTR)((LPSTR)lpks+lpks->dchSource)
  64. #define lpDest(lpks)   (LPSTR)((LPSTR)lpks+lpks->dchDest)
  65. #endif // KOREA
  66.  
  67. //
  68. //      Virtual Keys
  69. //
  70. #ifdef KOREA    // BeomOh - 9/29/92
  71. #define VK_FINAL        0x18    /* dummy VK to make final on mouse down */
  72. #define VK_CONVERT      0x1C
  73. #define VK_NONCONVERT   0x1D
  74. #define VK_ACCEPT       0x1E
  75. #define VK_MODECHANGE   0x1F
  76. #else // KOREA
  77. #define VK_KANA         0x15
  78. #define VK_KANJI        0x19
  79.  
  80. #define VK_CONVERT      0x1C
  81. #define VK_NONCONVERT   0x1D
  82. #define VK_ACCEPT       0x1E
  83. #define VK_MODECHANGE   0x1F
  84.  
  85. #define VK_DBE_ALPHANUMERIC              0x0f0
  86. #define VK_DBE_KATAKANA                  0x0f1
  87. #define VK_DBE_HIRAGANA                  0x0f2
  88. #define VK_DBE_SBCSCHAR                  0x0f3
  89. #define VK_DBE_DBCSCHAR                  0x0f4
  90. #define VK_DBE_ROMAN                     0x0f5
  91. #define VK_DBE_NOROMAN                   0x0f6
  92. #define VK_DBE_ENTERWORDREGISTERMODE     0x0f7
  93. #define VK_DBE_ENTERIMECONFIGMODE        0x0f8
  94. #define VK_DBE_FLUSHSTRING               0x0f9
  95. #define VK_DBE_CODEINPUT                 0x0fa
  96. #define VK_DBE_NOCODEINPUT               0x0fb
  97. #define VK_DBE_DETERMINESTRING           0x0fc
  98. #define VK_DBE_ENTERDLGCONVERSIONMODE    0x0fd
  99. #endif // KOREA
  100.  
  101.  
  102. //
  103. //     switch for wParam of IME_SETCONVERSIONWINDOW
  104. //
  105. #define MCW_DEFAULT             0x00
  106. #define MCW_RECT                0x01
  107. #define MCW_WINDOW              0x02
  108. #define MCW_SCREEN              0x04
  109. #define MCW_VERTICAL            0x08
  110. #define MCW_HIDDEN              0x10
  111.  
  112. //
  113. //    switch for wParam of IME_SETCONVERSIONMODE
  114. //       and IME_GETCONVERSIONMODE
  115. //
  116. #define IME_MODE_ALPHANUMERIC   0x0001
  117. #ifdef KOREA    // BeomOh - 9/29/92
  118. #define IME_MODE_SBCSCHAR       0x0002
  119. #define IME_MODE_HANJACONVERT   0x0004
  120. #else  // !KOREA
  121. #define IME_MODE_KATAKANA       0x0002
  122. #define IME_MODE_HIRAGANA       0x0004
  123. #define IME_MODE_SBCSCHAR       0x0008
  124. #define IME_MODE_DBCSCHAR       0x0010
  125. #define IME_MODE_ROMAN          0x0020
  126. #define IME_MODE_NOROMAN        0x0040
  127. #define IME_MODE_CODEINPUT      0x0080
  128. #define IME_MODE_NOCODEINPUT    0x0100
  129. //
  130. //
  131. #endif // !KOREA
  132.  
  133. //
  134. //     IME APIs
  135. //
  136. #define IME_GETIMECAPS            0x03
  137. #define IME_SETOPEN               0x04
  138. #define IME_GETOPEN               0x05
  139. #define IME_GETVERSION            0x07
  140. #define IME_SETCONVERSIONWINDOW   0x08
  141. #ifdef  KOREA
  142. #define IME_MOVEIMEWINDOW         IME_SETCONVERSIONWINDOW
  143. #else
  144. #endif
  145. #define IME_SETCONVERSIONMODE     0x10
  146. #ifdef KOREA    // BeomOh - 10/23/92
  147. #define IME_SET_MODE              0x12
  148. #else
  149. #endif
  150. #define IME_GETCONVERSIONMODE     0x11
  151. #define IME_SENDVKEY              0x13
  152. #define IME_ENTERWORDREGISTERMODE 0x18
  153. #define IME_SETCONVERSIONFONTEX   0x19
  154. #ifdef  KOREA   // 01/12/93 KDLee MSCH
  155. #endif
  156.  
  157.  
  158. #ifdef KOREA    // BeomOh - 9/29/92
  159. //
  160. // IME_CODECONVERT subfunctions
  161. //
  162. #define IME_BANJAtoJUNJA        0x13
  163. #define IME_JUNJAtoBANJA        0x14
  164. #define IME_JOHABtoKS           0x15
  165. #define IME_KStoJOHAB           0x16
  166.  
  167. //
  168. // IME_AUTOMATA subfunctions
  169. //
  170. #define IMEA_INIT               0x01
  171. #define IMEA_NEXT               0x02
  172. #define IMEA_PREV               0x03
  173.  
  174. //
  175. // IME_HANJAMODE subfunctions
  176. //
  177. #define IME_REQUEST_CONVERT     0x01
  178. #define IME_ENABLE_CONVERT      0x02
  179.  
  180. //
  181. // IME_MOVEIMEWINDOW subfunctions
  182. //
  183. #define INTERIM_WINDOW          0x00
  184. #define MODE_WINDOW             0x01
  185. #define HANJA_WINDOW            0x02
  186. #endif // KOREA
  187.  
  188. //
  189. //
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197. // CTRL_MODIFY is "or" all modify bits, but now only one
  198.  
  199. //
  200. //    error code
  201. //
  202. #define IME_RS_ERROR            0x01    // genetal error
  203. #define IME_RS_NOIME            0x02    // IME is not installed
  204. #define IME_RS_TOOLONG          0x05    // given string is too long
  205. #define IME_RS_ILLEGAL          0x06    // illegal charactor(s) is string
  206. #define IME_RS_NOTFOUND         0x07    // no (more) candidate
  207. #define IME_RS_NOROOM           0x0a    // no disk/memory space
  208. #define IME_RS_DISKERROR        0x0e    // disk I/O error
  209. #define IME_RS_INVALID          0x11    // Win3.1/NT
  210. #define IME_RS_NEST             0x12    // called nested
  211. #define IME_RS_SYSTEMMODAL      0x13    // called when system mode
  212.  
  213. //
  214. //   report messge from IME to WinApps
  215. //
  216. #define WM_IME_REPORT       0x0280
  217.  
  218. //
  219. //   report message parameter for WM_IME_REPORT
  220. //
  221. #define IR_STRINGSTART      0x100
  222. #define IR_STRINGEND        0x101
  223. #define IR_OPENCONVERT      0x120
  224. #define IR_CHANGECONVERT    0x121
  225. #define IR_CLOSECONVERT     0x122
  226. #define IR_FULLCONVERT      0x123
  227. #define IR_IMESELECT        0x130
  228. #define IR_STRING       0x140
  229. #define IR_DBCSCHAR             0x160
  230. #define IR_UNDETERMINE          0x170
  231. #define IR_STRINGEX             0x180   // New for 3.1
  232. #define IR_MODEINFO             0x190
  233.  
  234. //#define WM_CONVERTREQUESTEX     0x0109
  235. #define WM_WNT_CONVERTREQUESTEX 0x0109 /* WM_CONVERTREQUESTEX: 109 for NT, 108 for OT */
  236. #define WM_CONVERTREQUEST       0x010A
  237. #define WM_CONVERTRESULT        0x010B
  238. #define WM_INTERIM              0x010C
  239.  
  240. #define WM_IMEKEYDOWN           0x290
  241. #define WM_IMEKEYUP             0x291
  242.  
  243.  
  244.  
  245.  
  246. //
  247. // UNDETERMINESTRING structure for IR_UNDETERMINE
  248. //
  249. typedef struct tagUNDETERMINESTRUCT {
  250.     DWORD    dwSize;
  251.     UINT     uDefIMESize;
  252.     UINT     uDefIMEPos;
  253.     UINT     uUndetTextLen;
  254.     UINT     uUndetTextPos;
  255.     UINT     uUndetAttrPos;
  256.     UINT     uCursorPos;
  257.     UINT     uDeltaStart;
  258.     UINT     uDetermineTextLen;
  259.     UINT     uDetermineTextPos;
  260.     UINT     uDetermineDelimPos;
  261.     UINT     uYomiTextLen;
  262.     UINT     uYomiTextPos;
  263.     UINT     uYomiDelimPos;
  264. } UNDETERMINESTRUCT,*PUNDETERMINESTRUCT,NEAR *NPUNDETERMINESTRUCT,FAR *LPUNDETERMINESTRUCT;
  265.  
  266.  
  267. typedef struct tagSTRINGEXSTRUCT {
  268.     DWORD    dwSize;
  269.     UINT     uDeterminePos;
  270.     UINT     uDetermineDelimPos;
  271.     UINT     uYomiPos;
  272.     UINT     uYomiDelimPos;
  273. } STRINGEXSTRUCT,NEAR *NPSTRINGEXSTRUCT,FAR *LPSTRINGEXSTRUCT;
  274.  
  275.  
  276. #if 0
  277. #define IMEMODE_CCHMAXTEXT 256
  278. typedef struct tagIMEMODEINFO {
  279.      DWORD     cchSystemTextLength;
  280.      CHAR_INFO aciSystemText[IMEMODE_CCHMAXTEXT];
  281.      DWORD     cchModeTextLength;
  282.      CHAR_INFO aciModeText[IMEMODE_CCHMAXTEXT];
  283. } IMEMODEINFO,*PIMEMODEINFO,*LPIMEMODEINFO;
  284. #endif
  285.  
  286. #ifdef __BORLANDC__
  287.   #include <poppack.h>
  288. #endif
  289.  
  290. #ifdef __cplusplus
  291. }
  292. #endif  /* __cplusplus */
  293.  
  294. #endif // _IME_
  295.