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