home *** CD-ROM | disk | FTP | other *** search
/ PC World Plus! (NZ) 2001 June / HDC50.iso / Runimage / Delphi50 / Source / Rtl / Win / IMM.PAS < prev    next >
Pascal/Delphi Source File  |  1999-08-11  |  38KB  |  885 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Run-time Library                 }
  5. {       Win32 IMM API Interface Unit                    }
  6. {                                                       }
  7. {       Copyright (c) 1985-1999, Microsoft Corporation  }
  8. {                                                       }
  9. {       Translator: Inprise Corporation                 }
  10. {                                                       }
  11. {*******************************************************}
  12.  
  13. unit Imm;
  14.  
  15. {$ALIGN ON}
  16. {$MINENUMSIZE 4}
  17. {$WEAKPACKAGEUNIT}
  18.  
  19. interface
  20.  
  21. uses Windows;
  22.  
  23. const
  24.   {$EXTERNALSYM VK_PROCESSKEY}
  25.   VK_PROCESSKEY = $E5;
  26.  
  27. type
  28.   {$EXTERNALSYM HIMC}
  29.   HIMC = Integer;
  30.  
  31.   PCompositionForm = ^TCompositionForm;
  32.   {$EXTERNALSYM tagCOMPOSITIONFORM}
  33.   tagCOMPOSITIONFORM = record
  34.     dwStyle: DWORD;
  35.     ptCurrentPos: TPOINT;
  36.     rcArea: TRECT;
  37.   end;
  38.   TCompositionForm = tagCOMPOSITIONFORM;
  39.   {$EXTERNALSYM COMPOSITIONFORM}
  40.   COMPOSITIONFORM = tagCOMPOSITIONFORM;
  41.  
  42.   PCandidateForm = ^TCandidateForm;
  43.   {$EXTERNALSYM tagCANDIDATEFORM}
  44.   tagCANDIDATEFORM = record
  45.     dwIndex: DWORD;
  46.     dwStyle: DWORD;
  47.     ptCurrentPos: TPOINT;
  48.     rcArea: TRECT;
  49.   end;
  50.   TCandidateForm = tagCANDIDATEFORM;
  51.   {$EXTERNALSYM CANDIDATEFORM}
  52.   CANDIDATEFORM = tagCANDIDATEFORM;
  53.  
  54.   PCandidateList = ^TCandidateList;
  55.   {$EXTERNALSYM tagCANDIDATELIST}
  56.   tagCANDIDATELIST = record
  57.     dwSize: DWORD;
  58.     dwStyle: DWORD;
  59.     dwCount: DWORD;
  60.     dwSelection: DWORD;
  61.     dwPageStart: DWORD;
  62.     dwPageSize: DWORD;
  63.     dwOffset: array[1..1] of DWORD;
  64.   end;
  65.   TCandidateList = tagCANDIDATELIST;
  66.   {$EXTERNALSYM CANDIDATELIST}
  67.   CANDIDATELIST = tagCANDIDATELIST;
  68.  
  69.   PRegisterWordA = ^TRegisterWordA;
  70.   PRegisterWordW = ^TRegisterWordW;
  71.   PRegisterWord = PRegisterWordA;
  72.   {$EXTERNALSYM tagREGISTERWORDA}
  73.   tagREGISTERWORDA = record
  74.     lpReading: PAnsiChar;
  75.     lpWord: PAnsiChar;
  76.   end;
  77.   {$EXTERNALSYM tagREGISTERWORDW}
  78.   tagREGISTERWORDW = record
  79.     lpReading: PWideChar;
  80.     lpWord: PWideChar;
  81.   end;
  82.   {$EXTERNALSYM tagREGISTERWORD}
  83.   tagREGISTERWORD = tagREGISTERWORDA;
  84.   TRegisterWordA = tagREGISTERWORDA;
  85.   TRegisterWordW = tagREGISTERWORDW;
  86.   TRegisterWord = TRegisterWordA;
  87.   {$EXTERNALSYM REGISTERWORDA}
  88.   REGISTERWORDA = tagREGISTERWORDA;
  89.   {$EXTERNALSYM REGISTERWORDW}
  90.   REGISTERWORDW = tagREGISTERWORDW;
  91.   {$EXTERNALSYM REGISTERWORD}
  92.   REGISTERWORD = REGISTERWORDA;
  93.  
  94. const 
  95.   {$EXTERNALSYM STYLE_DESCRIPTION_SIZE}
  96.   STYLE_DESCRIPTION_SIZE = 32;
  97.  
  98. type
  99.   PStyleBufA = ^TStyleBufA;
  100.   PStyleBufW = ^TStyleBufW;
  101.   PStyleBuf = PStyleBufA;
  102.   {$EXTERNALSYM tagSTYLEBUFA}
  103.   tagSTYLEBUFA = record
  104.     dwStyle: DWORD;
  105.     szDescription: array[0..STYLE_DESCRIPTION_SIZE-1] of AnsiChar; 
  106.   end;
  107.   {$EXTERNALSYM tagSTYLEBUFW}
  108.   tagSTYLEBUFW = record
  109.     dwStyle: DWORD;
  110.     szDescription: array[0..STYLE_DESCRIPTION_SIZE-1] of WideChar; 
  111.   end;
  112.   {$EXTERNALSYM tagSTYLEBUF}
  113.   tagSTYLEBUF = tagSTYLEBUFA;
  114.   TStyleBufA = tagSTYLEBUFA;
  115.   TStyleBufW = tagSTYLEBUFW;
  116.   TStyleBuf = TStyleBufA;
  117.   {$EXTERNALSYM STYLEBUFA}
  118.   STYLEBUFA = tagSTYLEBUFA;
  119.   {$EXTERNALSYM STYLEBUFW}
  120.   STYLEBUFW = tagSTYLEBUFW;
  121.   {$EXTERNALSYM STYLEBUF}
  122.   STYLEBUF = STYLEBUFA;
  123.  
  124. { prototype of IMM API }
  125.  
  126. {$EXTERNALSYM ImmInstallIMEA}
  127. function ImmInstallIMEA(lpszIMEFileName, lpszLayoutText: PAnsiChar): HKL; stdcall;
  128. {$EXTERNALSYM ImmInstallIMEW}
  129. function ImmInstallIMEW(lpszIMEFileName, lpszLayoutText: PWideChar): HKL; stdcall;
  130. {$EXTERNALSYM ImmInstallIME}
  131. function ImmInstallIME(lpszIMEFileName, lpszLayoutText: PChar): HKL; stdcall;
  132.  
  133. {$EXTERNALSYM ImmGetDefaultIMEWnd}
  134. function ImmGetDefaultIMEWnd(hWnd: HWND): HWND; stdcall;
  135.  
  136. {$EXTERNALSYM ImmGetDescriptionA}
  137. function ImmGetDescriptionA(hKl: HKL; PAnsiChar: PAnsiChar; uBufLen: UINT): UINT; stdcall;
  138. {$EXTERNALSYM ImmGetDescriptionW}
  139. function ImmGetDescriptionW(hKl: HKL; PWideChar: PWideChar; uBufLen: UINT): UINT; stdcall;
  140. {$EXTERNALSYM ImmGetDescription}
  141. function ImmGetDescription(hKl: HKL; PChar: PChar; uBufLen: UINT): UINT; stdcall;
  142.  
  143. {$EXTERNALSYM ImmGetIMEFileNameA}
  144. function ImmGetIMEFileNameA(hKl: HKL; PAnsiChar: PAnsiChar; uBufLen: UINT): UINT; stdcall;
  145. {$EXTERNALSYM ImmGetIMEFileNameW}
  146. function ImmGetIMEFileNameW(hKl: HKL; PWideChar: PWideChar; uBufLen: UINT): UINT; stdcall;
  147. {$EXTERNALSYM ImmGetIMEFileName}
  148. function ImmGetIMEFileName(hKl: HKL; PChar: PChar; uBufLen: UINT): UINT; stdcall;
  149.  
  150. {$EXTERNALSYM ImmGetProperty}
  151. function ImmGetProperty(hKl: HKL; dWord: DWORD): DWORD; stdcall;
  152.  
  153. {$EXTERNALSYM ImmIsIME}
  154. function ImmIsIME(hKl: HKL): Boolean; stdcall;
  155.  
  156. {$EXTERNALSYM ImmSimulateHotKey}
  157. function ImmSimulateHotKey(hWnd: HWND; dWord: DWORD): Boolean; stdcall;
  158.  
  159. {$EXTERNALSYM ImmCreateContext}
  160. function ImmCreateContext: HIMC; stdcall;
  161. {$EXTERNALSYM ImmDestroyContext}
  162. function ImmDestroyContext(hImc: HIMC): Boolean; stdcall;
  163. {$EXTERNALSYM ImmGetContext}
  164. function ImmGetContext(hWnd: HWND): HIMC; stdcall;
  165. {$EXTERNALSYM ImmReleaseContext}
  166. function ImmReleaseContext(hWnd: HWND; hImc: HIMC): Boolean; stdcall;
  167. {$EXTERNALSYM ImmAssociateContext}
  168. function ImmAssociateContext(hWnd: HWND; hImc: HIMC): HIMC; stdcall;
  169.  
  170. {$EXTERNALSYM ImmGetCompositionStringA}
  171. function ImmGetCompositionStringA(hImc: HIMC; dWord1: DWORD; lpBuf: pointer; dwBufLen: DWORD): Longint; stdcall;
  172. {$EXTERNALSYM ImmGetCompositionStringW}
  173. function ImmGetCompositionStringW(hImc: HIMC; dWord1: DWORD; lpBuf: pointer; dwBufLen: DWORD): Longint; stdcall;
  174. {$EXTERNALSYM ImmGetCompositionString}
  175. function ImmGetCompositionString(hImc: HIMC; dWord1: DWORD; lpBuf: pointer; dwBufLen: DWORD): Longint; stdcall;
  176.  
  177. {$EXTERNALSYM ImmSetCompositionStringA}
  178. function ImmSetCompositionStringA(hImc: HIMC; dwIndex: DWORD; lpComp: pointer; dwCompLen: DWORD; lpRead: pointer; dwReadLen: DWORD):Boolean; stdcall;
  179. {$EXTERNALSYM ImmSetCompositionStringW}
  180. function ImmSetCompositionStringW(hImc: HIMC; dwIndex: DWORD; lpComp: pointer; dwCompLen: DWORD; lpRead: pointer; dwReadLen: DWORD):Boolean; stdcall;
  181. {$EXTERNALSYM ImmSetCompositionString}
  182. function ImmSetCompositionString(hImc: HIMC; dwIndex: DWORD; lpComp: pointer; dwCompLen: DWORD; lpRead: pointer; dwReadLen: DWORD):Boolean; stdcall;
  183.  
  184. {$EXTERNALSYM ImmGetCandidateListCountA}
  185. function ImmGetCandidateListCountA(hImc: HIMC; var ListCount: DWORD): DWORD; stdcall;
  186. {$EXTERNALSYM ImmGetCandidateListCountW}
  187. function ImmGetCandidateListCountW(hImc: HIMC; var ListCount: DWORD): DWORD; stdcall;
  188. {$EXTERNALSYM ImmGetCandidateListCount}
  189. function ImmGetCandidateListCount(hImc: HIMC; var ListCount: DWORD): DWORD; stdcall;
  190.  
  191. {$EXTERNALSYM ImmGetCandidateListA}
  192. function ImmGetCandidateListA(hImc: HIMC; deIndex: DWORD; lpCandidateList: PCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall;
  193. {$EXTERNALSYM ImmGetCandidateListW}
  194. function ImmGetCandidateListW(hImc: HIMC; deIndex: DWORD; lpCandidateList: PCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall;
  195. {$EXTERNALSYM ImmGetCandidateList}
  196. function ImmGetCandidateList(hImc: HIMC; deIndex: DWORD; lpCandidateList: PCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall;
  197.  
  198. {$EXTERNALSYM ImmGetGuideLineA}
  199. function ImmGetGuideLineA(hImc: HIMC; dwIndex: DWORD; lpBuf: PAnsiChar; dwBufLen: DWORD): DWORD; stdcall;
  200. {$EXTERNALSYM ImmGetGuideLineW}
  201. function ImmGetGuideLineW(hImc: HIMC; dwIndex: DWORD; lpBuf: PWideChar; dwBufLen: DWORD): DWORD; stdcall;
  202. {$EXTERNALSYM ImmGetGuideLine}
  203. function ImmGetGuideLine(hImc: HIMC; dwIndex: DWORD; lpBuf: PChar; dwBufLen: DWORD): DWORD; stdcall;
  204.  
  205. {$EXTERNALSYM ImmGetConversionStatus}
  206. function ImmGetConversionStatus(hImc: HIMC; var Conversion, Sentence: DWORD): Boolean; stdcall;
  207. {$EXTERNALSYM ImmSetConversionStatus}
  208. function ImmSetConversionStatus(hImc: HIMC; Conversion, Sentence: DWORD): Boolean; stdcall;
  209. {$EXTERNALSYM ImmGetOpenStatus}
  210. function ImmGetOpenStatus(hImc: HIMC): Boolean; stdcall;
  211. {$EXTERNALSYM ImmSetOpenStatus}
  212. function ImmSetOpenStatus(hImc: HIMC; fOpen: Boolean): Boolean; stdcall;
  213.  
  214. {$EXTERNALSYM ImmGetCompositionFontA}
  215. function ImmGetCompositionFontA(hImc: HIMC; lpLogfont: PLOGFONTA): Boolean; stdcall;
  216. {$EXTERNALSYM ImmGetCompositionFontW}
  217. function ImmGetCompositionFontW(hImc: HIMC; lpLogfont: PLOGFONTW): Boolean; stdcall;
  218. {$EXTERNALSYM ImmGetCompositionFont}
  219. function ImmGetCompositionFont(hImc: HIMC; lpLogfont: PLOGFONT): Boolean; stdcall;
  220.  
  221. {$EXTERNALSYM ImmSetCompositionFontA}
  222. function ImmSetCompositionFontA(hImc: HIMC; lpLogfont: PLOGFONTA): Boolean; stdcall;
  223. {$EXTERNALSYM ImmSetCompositionFontW}
  224. function ImmSetCompositionFontW(hImc: HIMC; lpLogfont: PLOGFONTW): Boolean; stdcall;
  225. {$EXTERNALSYM ImmSetCompositionFont}
  226. function ImmSetCompositionFont(hImc: HIMC; lpLogfont: PLOGFONT): Boolean; stdcall;
  227.  
  228. {$EXTERNALSYM ImmConfigureIMEA}
  229. function ImmConfigureIMEA(hKl: HKL; hWnd: HWND; dwMode: DWORD; lpData: pointer): Boolean; stdcall;
  230. {$EXTERNALSYM ImmConfigureIMEW}
  231. function ImmConfigureIMEW(hKl: HKL; hWnd: HWND; dwMode: DWORD; lpData: pointer): Boolean; stdcall;
  232. {$EXTERNALSYM ImmConfigureIME}
  233. function ImmConfigureIME(hKl: HKL; hWnd: HWND; dwMode: DWORD; lpData: pointer): Boolean; stdcall;
  234.  
  235. {$EXTERNALSYM ImmEscapeA}
  236. function ImmEscapeA(hKl: HKL; hImc: HIMC; uEscape: UINT; lpData: pointer): LRESULT; stdcall;
  237. {$EXTERNALSYM ImmEscapeW}
  238. function ImmEscapeW(hKl: HKL; hImc: HIMC; uEscape: UINT; lpData: pointer): LRESULT; stdcall;
  239. {$EXTERNALSYM ImmEscape}
  240. function ImmEscape(hKl: HKL; hImc: HIMC; uEscape: UINT; lpData: pointer): LRESULT; stdcall;
  241.  
  242. {$EXTERNALSYM ImmGetConversionListA}
  243. function ImmGetConversionListA(hKl: HKL; hImc: HIMC; lpSrc: PAnsiChar; lpDst: PCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT ): DWORD; stdcall;
  244. {$EXTERNALSYM ImmGetConversionListW}
  245. function ImmGetConversionListW(hKl: HKL; hImc: HIMC; lpSrc: PWideChar; lpDst: PCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT ): DWORD; stdcall;
  246. {$EXTERNALSYM ImmGetConversionList}
  247. function ImmGetConversionList(hKl: HKL; hImc: HIMC; lpSrc: PChar; lpDst: PCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT ): DWORD; stdcall;
  248.  
  249. {$EXTERNALSYM ImmNotifyIME}
  250. function ImmNotifyIME(hImc: HIMC; dwAction, dwIndex, dwValue: DWORD): Boolean; stdcall;
  251.  
  252. {$EXTERNALSYM ImmGetStatusWindowPos}
  253. function ImmGetStatusWindowPos(hImc: HIMC; var lpPoint : TPoint): Boolean; stdcall;
  254. {$EXTERNALSYM ImmSetStatusWindowPos}
  255. function ImmSetStatusWindowPos(hImc: HIMC; lpPoint: PPOINT): Boolean; stdcall;
  256. {$EXTERNALSYM ImmGetCompositionWindow}
  257. function ImmGetCompositionWindow(hImc: HIMC; lpCompForm: PCOMPOSITIONFORM): Boolean; stdcall;
  258. {$EXTERNALSYM ImmSetCompositionWindow}
  259. function ImmSetCompositionWindow(hImc: HIMC; lpCompForm: PCOMPOSITIONFORM): Boolean; stdcall;
  260. {$EXTERNALSYM ImmGetCandidateWindow}
  261. function ImmGetCandidateWindow(hImc: HIMC; dwBufLen: DWORD; lpCandidate: PCANDIDATEFORM): Boolean; stdcall;
  262. {$EXTERNALSYM ImmSetCandidateWindow}
  263. function ImmSetCandidateWindow(hImc: HIMC; lpCandidate: PCANDIDATEFORM): Boolean; stdcall;
  264.  
  265. {$EXTERNALSYM ImmIsUIMessageA}
  266. function ImmIsUIMessageA(hWnd: HWND; msg: UINT; wParam: WPARAM; lParam: LPARAM): Boolean; stdcall;
  267. {$EXTERNALSYM ImmIsUIMessageW}
  268. function ImmIsUIMessageW(hWnd: HWND; msg: UINT; wParam: WPARAM; lParam: LPARAM): Boolean; stdcall;
  269. {$EXTERNALSYM ImmIsUIMessage}
  270. function ImmIsUIMessage(hWnd: HWND; msg: UINT; wParam: WPARAM; lParam: LPARAM): Boolean; stdcall;
  271.  
  272. {$EXTERNALSYM ImmGetVirtualKey}
  273. function ImmGetVirtualKey(hWnd: HWND): UINT; stdcall;
  274.  
  275. type
  276.   RegisterWordEnumProcA = Function(lpReading: PAnsiChar; dwStyle: DWORD; lpszString: PAnsiChar; lpData: pointer): integer;
  277.   {$EXTERNALSYM RegisterWordEnumProcA}
  278.   RegisterWordEnumProcW = Function(lpReading: PWideChar; dwStyle: DWORD; lpszString: PWideChar; lpData: pointer): integer;
  279.   {$EXTERNALSYM RegisterWordEnumProcW}
  280.   RegisterWordEnumProc = RegisterWordEnumProcA;
  281.  
  282. {$EXTERNALSYM ImmRegisterWordA}
  283. function ImmRegisterWordA(hKl: HKL; lpszReading: PAnsiChar; dwStyle: DWORD; lpszRegister: PAnsiChar): Boolean; stdcall;
  284. {$EXTERNALSYM ImmRegisterWordW}
  285. function ImmRegisterWordW(hKl: HKL; lpszReading: PWideChar; dwStyle: DWORD; lpszRegister: PWideChar): Boolean; stdcall;
  286. {$EXTERNALSYM ImmRegisterWord}
  287. function ImmRegisterWord(hKl: HKL; lpszReading: PChar; dwStyle: DWORD; lpszRegister: PChar): Boolean; stdcall;
  288.  
  289. {$EXTERNALSYM ImmUnregisterWordA}
  290. function ImmUnregisterWordA(hKl: HKL; lpszReading: PAnsiChar; dwStyle: DWORD; lpszUnregister: PAnsiChar): Boolean; stdcall;
  291. {$EXTERNALSYM ImmUnregisterWordW}
  292. function ImmUnregisterWordW(hKl: HKL; lpszReading: PWideChar; dwStyle: DWORD; lpszUnregister: PWideChar): Boolean; stdcall;
  293. {$EXTERNALSYM ImmUnregisterWord}
  294. function ImmUnregisterWord(hKl: HKL; lpszReading: PChar; dwStyle: DWORD; lpszUnregister: PChar): Boolean; stdcall;
  295.  
  296. {$EXTERNALSYM ImmGetRegisterWordStyleA}
  297. function ImmGetRegisterWordStyleA(hKl: HKL; nItem: UINT; lpStyleBuf: PSTYLEBUFA): UINT; stdcall;
  298. {$EXTERNALSYM ImmGetRegisterWordStyleW}
  299. function ImmGetRegisterWordStyleW(hKl: HKL; nItem: UINT; lpStyleBuf: PSTYLEBUFW): UINT; stdcall;
  300. {$EXTERNALSYM ImmGetRegisterWordStyle}
  301. function ImmGetRegisterWordStyle(hKl: HKL; nItem: UINT; lpStyleBuf: PSTYLEBUF): UINT; stdcall;
  302.  
  303. {$EXTERNALSYM ImmEnumRegisterWordA}
  304. function ImmEnumRegisterWordA(hKl: HKL; lpfnEnumProc: REGISTERWORDENUMPROCA; lpszReading: PAnsiChar; dwStyle: DWORD; lpszRegister: PAnsiChar; lpData : pointer): UINT; stdcall;
  305. {$EXTERNALSYM ImmEnumRegisterWordW}
  306. function ImmEnumRegisterWordW(hKl: HKL; lpfnEnumProc: REGISTERWORDENUMPROCW; lpszReading: PWideChar; dwStyle: DWORD; lpszRegister: PWideChar; lpData : pointer): UINT; stdcall;
  307. {$EXTERNALSYM ImmEnumRegisterWord}
  308. function ImmEnumRegisterWord(hKl: HKL; lpfnEnumProc: REGISTERWORDENUMPROC; lpszReading: PChar; dwStyle: DWORD; lpszRegister: PChar; lpData : pointer): UINT; stdcall;
  309.  
  310. const
  311. { the IME related messages  ( removed in 4.0 SDK }
  312.   {$EXTERNALSYM WM_CONVERTREQUESTEX}
  313.   WM_CONVERTREQUESTEX            = $0108;
  314.   {$EXTERNALSYM WM_IME_STARTCOMPOSITION}
  315.   WM_IME_STARTCOMPOSITION        = $010D;
  316.   {$EXTERNALSYM WM_IME_ENDCOMPOSITION}
  317.   WM_IME_ENDCOMPOSITION          = $010E;
  318.   {$EXTERNALSYM WM_IME_COMPOSITION}
  319.   WM_IME_COMPOSITION             = $010F;
  320.   {$EXTERNALSYM WM_IME_KEYLAST}
  321.   WM_IME_KEYLAST                 = $010F;
  322.  
  323.   {$EXTERNALSYM WM_IME_SETCONTEXT}
  324.   WM_IME_SETCONTEXT              = $0281;
  325.   {$EXTERNALSYM WM_IME_NOTIFY}
  326.   WM_IME_NOTIFY                  = $0282;
  327.   {$EXTERNALSYM WM_IME_CONTROL}
  328.   WM_IME_CONTROL                 = $0283;
  329.   {$EXTERNALSYM WM_IME_COMPOSITIONFULL}
  330.   WM_IME_COMPOSITIONFULL         = $0284;
  331.   {$EXTERNALSYM WM_IME_SELECT}
  332.   WM_IME_SELECT                  = $0285;
  333.   {$EXTERNALSYM WM_IME_CHAR}
  334.   WM_IME_CHAR                    = $0286;
  335.  
  336.   {$EXTERNALSYM WM_IME_KEYDOWN}
  337.   WM_IME_KEYDOWN                 = $0290;
  338.   {$EXTERNALSYM WM_IME_KEYUP}
  339.   WM_IME_KEYUP                   = $0291;
  340.  
  341. { wParam for WM_IME_CONTROL }
  342.   {$EXTERNALSYM IMC_GETCANDIDATEPOS}
  343.   IMC_GETCANDIDATEPOS            = $0007;
  344.   {$EXTERNALSYM IMC_SETCANDIDATEPOS}
  345.   IMC_SETCANDIDATEPOS            = $0008;
  346.   {$EXTERNALSYM IMC_GETCOMPOSITIONFONT}
  347.   IMC_GETCOMPOSITIONFONT         = $0009;
  348.   {$EXTERNALSYM IMC_SETCOMPOSITIONFONT}
  349.   IMC_SETCOMPOSITIONFONT         = $000A;
  350.   {$EXTERNALSYM IMC_GETCOMPOSITIONWINDOW}
  351.   IMC_GETCOMPOSITIONWINDOW       = $000B;
  352.   {$EXTERNALSYM IMC_SETCOMPOSITIONWINDOW}
  353.   IMC_SETCOMPOSITIONWINDOW       = $000C;
  354.   {$EXTERNALSYM IMC_GETSTATUSWINDOWPOS}
  355.   IMC_GETSTATUSWINDOWPOS         = $000F;
  356.   {$EXTERNALSYM IMC_SETSTATUSWINDOWPOS}
  357.   IMC_SETSTATUSWINDOWPOS         = $0010;
  358.   {$EXTERNALSYM IMC_CLOSESTATUSWINDOW}
  359.   IMC_CLOSESTATUSWINDOW          = $0021;
  360.   {$EXTERNALSYM IMC_OPENSTATUSWINDOW}
  361.   IMC_OPENSTATUSWINDOW           = $0022;
  362.  
  363. { wParam for WM_IME_CONTROL to the soft keyboard }
  364. { dwAction for ImmNotifyIME }
  365.   {$EXTERNALSYM NI_OPENCANDIDATE}
  366.   NI_OPENCANDIDATE               = $0010;
  367.   {$EXTERNALSYM NI_CLOSECANDIDATE}
  368.   NI_CLOSECANDIDATE              = $0011;
  369.   {$EXTERNALSYM NI_SELECTCANDIDATESTR}
  370.   NI_SELECTCANDIDATESTR          = $0012;
  371.   {$EXTERNALSYM NI_CHANGECANDIDATELIST}
  372.   NI_CHANGECANDIDATELIST         = $0013;
  373.   {$EXTERNALSYM NI_FINALIZECONVERSIONRESULT}
  374.   NI_FINALIZECONVERSIONRESULT    = $0014;
  375.   {$EXTERNALSYM NI_COMPOSITIONSTR}
  376.   NI_COMPOSITIONSTR              = $0015;
  377.   {$EXTERNALSYM NI_SETCANDIDATE_PAGESTART}
  378.   NI_SETCANDIDATE_PAGESTART      = $0016;
  379.   {$EXTERNALSYM NI_SETCANDIDATE_PAGESIZE}
  380.   NI_SETCANDIDATE_PAGESIZE       = $0017;
  381.  
  382. { lParam for WM_IME_SETCONTEXT }
  383.   {$EXTERNALSYM ISC_SHOWUICANDIDATEWINDOW}
  384.   ISC_SHOWUICANDIDATEWINDOW      = $00000001;
  385.   {$EXTERNALSYM ISC_SHOWUICOMPOSITIONWINDOW}
  386.   ISC_SHOWUICOMPOSITIONWINDOW    = $80000000;
  387.   {$EXTERNALSYM ISC_SHOWUIGUIDELINE}
  388.   ISC_SHOWUIGUIDELINE            = $40000000;
  389.   {$EXTERNALSYM ISC_SHOWUIALLCANDIDATEWINDOW}
  390.   ISC_SHOWUIALLCANDIDATEWINDOW   = $0000000F;
  391.   {$EXTERNALSYM ISC_SHOWUIALL}
  392.   ISC_SHOWUIALL                  = $C000000F;
  393.  
  394. { dwIndex for ImmNotifyIME/NI_COMPOSITIONSTR }
  395.   {$EXTERNALSYM CPS_COMPLETE}
  396.   CPS_COMPLETE                   = $0001;
  397.   {$EXTERNALSYM CPS_CONVERT}
  398.   CPS_CONVERT                    = $0002;
  399.   {$EXTERNALSYM CPS_REVERT}
  400.   CPS_REVERT                     = $0003;
  401.   {$EXTERNALSYM CPS_CANCEL}
  402.   CPS_CANCEL                     = $0004;
  403.  
  404. { the modifiers of hot key }
  405.   {$EXTERNALSYM MOD_ALT}
  406.   MOD_ALT                        = $0001;
  407.   {$EXTERNALSYM MOD_CONTROL}
  408.   MOD_CONTROL                    = $0002;
  409.   {$EXTERNALSYM MOD_SHIFT}
  410.   MOD_SHIFT                      = $0004;
  411.  
  412.   {$EXTERNALSYM MOD_LEFT}
  413.   MOD_LEFT                       = $8000;
  414.   {$EXTERNALSYM MOD_RIGHT}
  415.   MOD_RIGHT                      = $4000;
  416.  
  417.   {$EXTERNALSYM MOD_ON_KEYUP}
  418.   MOD_ON_KEYUP                   = $0800;
  419.   {$EXTERNALSYM MOD_IGNORE_ALL_MODIFIER}
  420.   MOD_IGNORE_ALL_MODIFIER        = $0400;
  421.  
  422. { Windows for Simplified Chinese Edition hot key ID from #10 - #2F }
  423.   {$EXTERNALSYM IME_CHOTKEY_IME_NONIME_TOGGLE}
  424.   IME_CHOTKEY_IME_NONIME_TOGGLE          = $10;
  425.   {$EXTERNALSYM IME_CHOTKEY_SHAPE_TOGGLE}
  426.   IME_CHOTKEY_SHAPE_TOGGLE               = $11;
  427.   {$EXTERNALSYM IME_CHOTKEY_SYMBOL_TOGGLE}
  428.   IME_CHOTKEY_SYMBOL_TOGGLE              = $12;
  429.  
  430. { Windows for Japanese Edition hot key ID from #30 - #4F }
  431.   {$EXTERNALSYM IME_JHOTKEY_CLOSE_OPEN}
  432.   IME_JHOTKEY_CLOSE_OPEN                 = $30;
  433.  
  434. { Windows for Korean Edition hot key ID from #50 - #6F }
  435.   {$EXTERNALSYM IME_KHOTKEY_SHAPE_TOGGLE}
  436.   IME_KHOTKEY_SHAPE_TOGGLE               = $50;
  437.   {$EXTERNALSYM IME_KHOTKEY_HANJACONVERT}
  438.   IME_KHOTKEY_HANJACONVERT               = $51;
  439.   {$EXTERNALSYM IME_KHOTKEY_ENGLISH}
  440.   IME_KHOTKEY_ENGLISH                    = $52;
  441.  
  442. { Windows for Tranditional Chinese Edition hot key ID from #70 - #8F }
  443.   {$EXTERNALSYM IME_THOTKEY_IME_NONIME_TOGGLE}
  444.   IME_THOTKEY_IME_NONIME_TOGGLE          = $70;
  445.   {$EXTERNALSYM IME_THOTKEY_SHAPE_TOGGLE}
  446.   IME_THOTKEY_SHAPE_TOGGLE               = $71;
  447.   {$EXTERNALSYM IME_THOTKEY_SYMBOL_TOGGLE}
  448.   IME_THOTKEY_SYMBOL_TOGGLE              = $72;
  449.  
  450. { direct switch hot key ID from #100 - #11F }
  451.   {$EXTERNALSYM IME_HOTKEY_DSWITCH_FIRST}
  452.   IME_HOTKEY_DSWITCH_FIRST               = $100;
  453.   {$EXTERNALSYM IME_HOTKEY_DSWITCH_LAST}
  454.   IME_HOTKEY_DSWITCH_LAST                = $11F;
  455.  
  456. { IME private hot key from #200 - #21F }
  457.   {$EXTERNALSYM IME_HOTKEY_PRIVATE_FIRST}
  458.   IME_HOTKEY_PRIVATE_FIRST               = $200;
  459.   {$EXTERNALSYM IME_ITHOTKEY_RESEND_RESULTSTR}
  460.   IME_ITHOTKEY_RESEND_RESULTSTR          = $200;
  461.   {$EXTERNALSYM IME_ITHOTKEY_PREVIOUS_COMPOSITION}
  462.   IME_ITHOTKEY_PREVIOUS_COMPOSITION      = $201;
  463.   {$EXTERNALSYM IME_ITHOTKEY_UISTYLE_TOGGLE}
  464.   IME_ITHOTKEY_UISTYLE_TOGGLE            = $202;
  465.   {$EXTERNALSYM IME_HOTKEY_PRIVATE_LAST}
  466.   IME_HOTKEY_PRIVATE_LAST                = $21F;
  467.  
  468. { parameter of ImmGetCompositionString }
  469.   {$EXTERNALSYM GCS_COMPREADSTR}
  470.   GCS_COMPREADSTR                = $0001;
  471.   {$EXTERNALSYM GCS_COMPREADATTR}
  472.   GCS_COMPREADATTR               = $0002;
  473.   {$EXTERNALSYM GCS_COMPREADCLAUSE}
  474.   GCS_COMPREADCLAUSE             = $0004;
  475.   {$EXTERNALSYM GCS_COMPSTR}
  476.   GCS_COMPSTR                    = $0008;
  477.   {$EXTERNALSYM GCS_COMPATTR}
  478.   GCS_COMPATTR                   = $0010;
  479.   {$EXTERNALSYM GCS_COMPCLAUSE}
  480.   GCS_COMPCLAUSE                 = $0020;
  481.   {$EXTERNALSYM GCS_CURSORPOS}
  482.   GCS_CURSORPOS                  = $0080;
  483.   {$EXTERNALSYM GCS_DELTASTART}
  484.   GCS_DELTASTART                 = $0100;
  485.   {$EXTERNALSYM GCS_RESULTREADSTR}
  486.   GCS_RESULTREADSTR              = $0200;
  487.   {$EXTERNALSYM GCS_RESULTREADCLAUSE}
  488.   GCS_RESULTREADCLAUSE           = $0400;
  489.   {$EXTERNALSYM GCS_RESULTSTR}
  490.   GCS_RESULTSTR                  = $0800;
  491.   {$EXTERNALSYM GCS_RESULTCLAUSE}
  492.   GCS_RESULTCLAUSE               = $1000;
  493.  
  494. { style bit flags for WM_IME_COMPOSITION }
  495.   {$EXTERNALSYM CS_INSERTCHAR}
  496.   CS_INSERTCHAR                  = $2000;
  497.   {$EXTERNALSYM CS_NOMOVECARET}
  498.   CS_NOMOVECARET                 = $4000;
  499.  
  500. { bits of fdwInit of INPUTCONTEXT }
  501. { IME version constants }
  502.   {$EXTERNALSYM IMEVER_0310}
  503.   IMEVER_0310                    = $0003000A;
  504.   {$EXTERNALSYM IMEVER_0400}
  505.   IMEVER_0400                    = $00040000;
  506.  
  507. { IME property bits }
  508.   {$EXTERNALSYM IME_PROP_AT_CARET}
  509.   IME_PROP_AT_CARET              = $00010000;
  510.   {$EXTERNALSYM IME_PROP_SPECIAL_UI}
  511.   IME_PROP_SPECIAL_UI            = $00020000;
  512.   {$EXTERNALSYM IME_PROP_CANDLIST_START_FROM_1}
  513.   IME_PROP_CANDLIST_START_FROM_1 = $00040000;
  514.   {$EXTERNALSYM IME_PROP_UNICODE}
  515.   IME_PROP_UNICODE               = $00080000;
  516.  
  517. { IME UICapability bits }
  518.   {$EXTERNALSYM UI_CAP_2700}
  519.   UI_CAP_2700                    = $00000001;
  520.   {$EXTERNALSYM UI_CAP_ROT90}
  521.   UI_CAP_ROT90                   = $00000002;
  522.   {$EXTERNALSYM UI_CAP_ROTANY}
  523.   UI_CAP_ROTANY                  = $00000004;
  524.  
  525. { ImmSetCompositionString Capability bits }
  526.   {$EXTERNALSYM SCS_CAP_COMPSTR}
  527.   SCS_CAP_COMPSTR                = $00000001;
  528.   {$EXTERNALSYM SCS_CAP_MAKEREAD}
  529.   SCS_CAP_MAKEREAD               = $00000002;
  530.  
  531. { IME WM_IME_SELECT inheritance Capability bits }
  532.   {$EXTERNALSYM SELECT_CAP_CONVERSION}
  533.   SELECT_CAP_CONVERSION          = $00000001;
  534.   {$EXTERNALSYM SELECT_CAP_SENTENCE}
  535.   SELECT_CAP_SENTENCE            = $00000002;
  536.  
  537. { ID for deIndex of ImmGetGuideLine }
  538.   {$EXTERNALSYM GGL_LEVEL}
  539.   GGL_LEVEL                      = $00000001;
  540.   {$EXTERNALSYM GGL_INDEX}
  541.   GGL_INDEX                      = $00000002;
  542.   {$EXTERNALSYM GGL_STRING}
  543.   GGL_STRING                     = $00000003;
  544.   {$EXTERNALSYM GGL_PRIVATE}
  545.   GGL_PRIVATE                    = $00000004;
  546.  
  547. { ID for dwLevel of GUIDELINE Structure }
  548.   {$EXTERNALSYM GL_LEVEL_NOGUIDELINE}
  549.   GL_LEVEL_NOGUIDELINE           = $00000000;
  550.   {$EXTERNALSYM GL_LEVEL_FATAL}
  551.   GL_LEVEL_FATAL                 = $00000001;
  552.   {$EXTERNALSYM GL_LEVEL_ERROR}
  553.   GL_LEVEL_ERROR                 = $00000002;
  554.   {$EXTERNALSYM GL_LEVEL_WARNING}
  555.   GL_LEVEL_WARNING               = $00000003;
  556.   {$EXTERNALSYM GL_LEVEL_INFORMATION}
  557.   GL_LEVEL_INFORMATION           = $00000004;
  558.  
  559. { ID for dwIndex of GUIDELINE Structure }
  560.   {$EXTERNALSYM GL_ID_UNKNOWN}
  561.   GL_ID_UNKNOWN                  = $00000000;
  562.   {$EXTERNALSYM GL_ID_NOMODULE}
  563.   GL_ID_NOMODULE                 = $00000001;
  564.   {$EXTERNALSYM GL_ID_NODICTIONARY}
  565.   GL_ID_NODICTIONARY             = $00000010;
  566.   {$EXTERNALSYM GL_ID_CANNOTSAVE}
  567.   GL_ID_CANNOTSAVE               = $00000011;
  568.   {$EXTERNALSYM GL_ID_NOCONVERT}
  569.   GL_ID_NOCONVERT                = $00000020;
  570.   {$EXTERNALSYM GL_ID_TYPINGERROR}
  571.   GL_ID_TYPINGERROR              = $00000021;
  572.   {$EXTERNALSYM GL_ID_TOOMANYSTROKE}
  573.   GL_ID_TOOMANYSTROKE            = $00000022;
  574.   {$EXTERNALSYM GL_ID_READINGCONFLICT}
  575.   GL_ID_READINGCONFLICT          = $00000023;
  576.   {$EXTERNALSYM GL_ID_INPUTREADING}
  577.   GL_ID_INPUTREADING             = $00000024;
  578.   {$EXTERNALSYM GL_ID_INPUTRADICAL}
  579.   GL_ID_INPUTRADICAL             = $00000025;
  580.   {$EXTERNALSYM GL_ID_INPUTCODE}
  581.   GL_ID_INPUTCODE                = $00000026;
  582.   {$EXTERNALSYM GL_ID_INPUTSYMBOL}
  583.   GL_ID_INPUTSYMBOL              = $00000027;
  584.   {$EXTERNALSYM GL_ID_CHOOSECANDIDATE}
  585.   GL_ID_CHOOSECANDIDATE          = $00000028;
  586.   {$EXTERNALSYM GL_ID_REVERSECONVERSION}
  587.   GL_ID_REVERSECONVERSION        = $00000029;
  588.   {$EXTERNALSYM GL_ID_PRIVATE_FIRST}
  589.   GL_ID_PRIVATE_FIRST            = $00008000;
  590.   {$EXTERNALSYM GL_ID_PRIVATE_LAST}
  591.   GL_ID_PRIVATE_LAST             = $0000FFFF;
  592.  
  593. { ID for dwIndex of ImmGetProperty }
  594.   {$EXTERNALSYM IGP_GETIMEVERSION}
  595.   IGP_GETIMEVERSION              = 4;
  596.   {$EXTERNALSYM IGP_PROPERTY}
  597.   IGP_PROPERTY                   = $00000004;
  598.   {$EXTERNALSYM IGP_CONVERSION}
  599.   IGP_CONVERSION                 = $00000008;
  600.   {$EXTERNALSYM IGP_SENTENCE}
  601.   IGP_SENTENCE                   = $0000000c;
  602.   {$EXTERNALSYM IGP_UI}
  603.   IGP_UI                         = $00000010;
  604.   {$EXTERNALSYM IGP_SETCOMPSTR}
  605.   IGP_SETCOMPSTR                 = $00000014;
  606.   {$EXTERNALSYM IGP_SELECT}
  607.   IGP_SELECT                     = $00000018;
  608.  
  609. { dwIndex for ImmSetCompositionString API }
  610.   {$EXTERNALSYM SCS_SETSTR}
  611.   SCS_SETSTR                     = (GCS_COMPREADSTR or GCS_COMPSTR);
  612.   {$EXTERNALSYM SCS_CHANGEATTR}
  613.   SCS_CHANGEATTR                 = (GCS_COMPREADATTR or GCS_COMPATTR);
  614.   {$EXTERNALSYM SCS_CHANGECLAUSE}
  615.   SCS_CHANGECLAUSE               = (GCS_COMPREADCLAUSE or GCS_COMPCLAUSE);
  616.  
  617. { attribute for COMPOSITIONSTRING Structure }
  618.   {$EXTERNALSYM ATTR_INPUT}
  619.   ATTR_INPUT                     = $00;
  620.   {$EXTERNALSYM ATTR_TARGET_CONVERTED}
  621.   ATTR_TARGET_CONVERTED          = $01;
  622.   {$EXTERNALSYM ATTR_CONVERTED}
  623.   ATTR_CONVERTED                 = $02;
  624.   {$EXTERNALSYM ATTR_TARGET_NOTCONVERTED}
  625.   ATTR_TARGET_NOTCONVERTED       = $03;
  626.   {$EXTERNALSYM ATTR_INPUT_ERROR}
  627.   ATTR_INPUT_ERROR               = $04;
  628.  
  629. { bit field for IMC_SETCOMPOSITIONWINDOW, IMC_SETCANDIDATEWINDOW }
  630.   {$EXTERNALSYM CFS_DEFAULT}
  631.   CFS_DEFAULT                    = $0000;
  632.   {$EXTERNALSYM CFS_RECT}
  633.   CFS_RECT                       = $0001;
  634.   {$EXTERNALSYM CFS_POINT}
  635.   CFS_POINT                      = $0002;
  636.   CFS_SCREEN                     = $0004;    { removed in 4.0 SDK }
  637.   {$EXTERNALSYM CFS_FORCE_POSITION}
  638.   CFS_FORCE_POSITION             = $0020;
  639.   {$EXTERNALSYM CFS_CANDIDATEPOS}
  640.   CFS_CANDIDATEPOS               = $0040;
  641.   {$EXTERNALSYM CFS_EXCLUDE}
  642.   CFS_EXCLUDE                    = $0080;
  643.  
  644. { conversion direction for ImmGetConversionList }
  645.   {$EXTERNALSYM GCL_CONVERSION}
  646.   GCL_CONVERSION                 = $0001;
  647.   {$EXTERNALSYM GCL_REVERSECONVERSION}
  648.   GCL_REVERSECONVERSION          = $0002;
  649.   {$EXTERNALSYM GCL_REVERSE_LENGTH}
  650.   GCL_REVERSE_LENGTH             = $0003;
  651.  
  652. { bit field for conversion mode }
  653.   {$EXTERNALSYM IME_CMODE_ALPHANUMERIC}
  654.   IME_CMODE_ALPHANUMERIC         = $0000;
  655.   {$EXTERNALSYM IME_CMODE_NATIVE}
  656.   IME_CMODE_NATIVE               = $0001;
  657.   {$EXTERNALSYM IME_CMODE_CHINESE}
  658.   IME_CMODE_CHINESE              = IME_CMODE_NATIVE;
  659.   {$EXTERNALSYM IME_CMODE_HANGEUL}
  660.   IME_CMODE_HANGEUL              = IME_CMODE_NATIVE;
  661.   {$EXTERNALSYM IME_CMODE_HANGUL}
  662.   IME_CMODE_HANGUL               = IME_CMODE_NATIVE;
  663.   {$EXTERNALSYM IME_CMODE_JAPANESE}
  664.   IME_CMODE_JAPANESE             = IME_CMODE_NATIVE;
  665.   {$EXTERNALSYM IME_CMODE_KATAKANA}
  666.   IME_CMODE_KATAKANA             = $0002;  { effective only under IME_CMODE_NATIVE}
  667.   {$EXTERNALSYM IME_CMODE_LANGUAGE}
  668.   IME_CMODE_LANGUAGE             = $0003;
  669.   {$EXTERNALSYM IME_CMODE_FULLSHAPE}
  670.   IME_CMODE_FULLSHAPE            = $0008;
  671.   {$EXTERNALSYM IME_CMODE_ROMAN}
  672.   IME_CMODE_ROMAN                = $0010;
  673.   {$EXTERNALSYM IME_CMODE_CHARCODE}
  674.   IME_CMODE_CHARCODE             = $0020;
  675.   {$EXTERNALSYM IME_CMODE_HANJACONVERT}
  676.   IME_CMODE_HANJACONVERT         = $0040;
  677.   {$EXTERNALSYM IME_CMODE_SOFTKBD}
  678.   IME_CMODE_SOFTKBD              = $0080;
  679.   {$EXTERNALSYM IME_CMODE_NOCONVERSION}
  680.   IME_CMODE_NOCONVERSION         = $0100;
  681.   {$EXTERNALSYM IME_CMODE_EUDC}
  682.   IME_CMODE_EUDC                 = $0200;
  683.   {$EXTERNALSYM IME_CMODE_SYMBOL}
  684.   IME_CMODE_SYMBOL               = $0400;
  685.  
  686.   {$EXTERNALSYM IME_SMODE_NONE}
  687.   IME_SMODE_NONE                 = $0000;
  688.   {$EXTERNALSYM IME_SMODE_PLAURALCLAUSE}
  689.   IME_SMODE_PLAURALCLAUSE        = $0001;
  690.   {$EXTERNALSYM IME_SMODE_SINGLECONVERT}
  691.   IME_SMODE_SINGLECONVERT        = $0002;
  692.   {$EXTERNALSYM IME_SMODE_AUTOMATIC}
  693.   IME_SMODE_AUTOMATIC            = $0004;
  694.   {$EXTERNALSYM IME_SMODE_PHRASEPREDICT}
  695.   IME_SMODE_PHRASEPREDICT        = $0008;
  696.  
  697. { style of candidate }
  698.   {$EXTERNALSYM IME_CAND_UNKNOWN}
  699.   IME_CAND_UNKNOWN               = $0000;
  700.   {$EXTERNALSYM IME_CAND_READ}
  701.   IME_CAND_READ                  = $0001;
  702.   {$EXTERNALSYM IME_CAND_CODE}
  703.   IME_CAND_CODE                  = $0002;
  704.   {$EXTERNALSYM IME_CAND_MEANING}
  705.   IME_CAND_MEANING               = $0003;
  706.   {$EXTERNALSYM IME_CAND_RADICAL}
  707.   IME_CAND_RADICAL               = $0004;
  708.   {$EXTERNALSYM IME_CAND_STROKE}
  709.   IME_CAND_STROKE                = $0005;
  710.  
  711. { wParam of report message WM_IME_NOTIFY }
  712.   {$EXTERNALSYM IMN_CLOSESTATUSWINDOW}
  713.   IMN_CLOSESTATUSWINDOW          = $0001;
  714.   {$EXTERNALSYM IMN_OPENSTATUSWINDOW}
  715.   IMN_OPENSTATUSWINDOW           = $0002;
  716.   {$EXTERNALSYM IMN_CHANGECANDIDATE}
  717.   IMN_CHANGECANDIDATE            = $0003;
  718.   {$EXTERNALSYM IMN_CLOSECANDIDATE}
  719.   IMN_CLOSECANDIDATE             = $0004;
  720.   {$EXTERNALSYM IMN_OPENCANDIDATE}
  721.   IMN_OPENCANDIDATE              = $0005;
  722.   {$EXTERNALSYM IMN_SETCONVERSIONMODE}
  723.   IMN_SETCONVERSIONMODE          = $0006;
  724.   {$EXTERNALSYM IMN_SETSENTENCEMODE}
  725.   IMN_SETSENTENCEMODE            = $0007;
  726.   {$EXTERNALSYM IMN_SETOPENSTATUS}
  727.   IMN_SETOPENSTATUS              = $0008;
  728.   {$EXTERNALSYM IMN_SETCANDIDATEPOS}
  729.   IMN_SETCANDIDATEPOS            = $0009;
  730.   {$EXTERNALSYM IMN_SETCOMPOSITIONFONT}
  731.   IMN_SETCOMPOSITIONFONT         = $000A;
  732.   {$EXTERNALSYM IMN_SETCOMPOSITIONWINDOW}
  733.   IMN_SETCOMPOSITIONWINDOW       = $000B;
  734.   {$EXTERNALSYM IMN_SETSTATUSWINDOWPOS}
  735.   IMN_SETSTATUSWINDOWPOS         = $000C;
  736.   {$EXTERNALSYM IMN_GUIDELINE}
  737.   IMN_GUIDELINE                  = $000D;
  738.   {$EXTERNALSYM IMN_PRIVATE}
  739.   IMN_PRIVATE                    = $000E;
  740.  
  741. { error code of ImmGetCompositionString }
  742.   {$EXTERNALSYM IMM_ERROR_NODATA}
  743.   IMM_ERROR_NODATA               = -1;
  744.   {$EXTERNALSYM IMM_ERROR_GENERAL}
  745.   IMM_ERROR_GENERAL              = -2;
  746.  
  747. { dialog mode of ImmConfigureIME }
  748.   {$EXTERNALSYM IME_CONFIG_GENERAL}
  749.   IME_CONFIG_GENERAL             = 1;
  750.   {$EXTERNALSYM IME_CONFIG_REGISTERWORD}
  751.   IME_CONFIG_REGISTERWORD        = 2;
  752.   {$EXTERNALSYM IME_CONFIG_SELECTDICTIONARY}
  753.   IME_CONFIG_SELECTDICTIONARY    = 3;
  754.  
  755. { dialog mode of ImmEscape }
  756.   {$EXTERNALSYM IME_ESC_QUERY_SUPPORT}
  757.   IME_ESC_QUERY_SUPPORT          = $0003;
  758.   {$EXTERNALSYM IME_ESC_RESERVED_FIRST}
  759.   IME_ESC_RESERVED_FIRST         = $0004;
  760.   {$EXTERNALSYM IME_ESC_RESERVED_LAST}
  761.   IME_ESC_RESERVED_LAST          = $07FF;
  762.   {$EXTERNALSYM IME_ESC_PRIVATE_FIRST}
  763.   IME_ESC_PRIVATE_FIRST          = $0800;
  764.   {$EXTERNALSYM IME_ESC_PRIVATE_LAST}
  765.   IME_ESC_PRIVATE_LAST           = $0FFF;
  766.   {$EXTERNALSYM IME_ESC_SEQUENCE_TO_INTERNAL}
  767.   IME_ESC_SEQUENCE_TO_INTERNAL   = $1001;
  768.   {$EXTERNALSYM IME_ESC_GET_EUDC_DICTIONARY}
  769.   IME_ESC_GET_EUDC_DICTIONARY    = $1003;
  770.   {$EXTERNALSYM IME_ESC_SET_EUDC_DICTIONARY}
  771.   IME_ESC_SET_EUDC_DICTIONARY    = $1004;
  772.   {$EXTERNALSYM IME_ESC_MAX_KEY}
  773.   IME_ESC_MAX_KEY                = $1005;
  774.   {$EXTERNALSYM IME_ESC_IME_NAME}
  775.   IME_ESC_IME_NAME               = $1006;
  776.   {$EXTERNALSYM IME_ESC_SYNC_HOTKEY}
  777.   IME_ESC_SYNC_HOTKEY            = $1007;
  778.   {$EXTERNALSYM IME_ESC_HANJA_MODE}
  779.   IME_ESC_HANJA_MODE             = $1008;
  780.   {$EXTERNALSYM IME_ESC_AUTOMATA}
  781.   IME_ESC_AUTOMATA               = $1009;
  782.  
  783.   {$EXTERNALSYM IME_ESC_PRIVATE_HOTKEY}
  784.   IME_ESC_PRIVATE_HOTKEY         = $100A;
  785.   
  786. { style of word registration }
  787.   {$EXTERNALSYM IME_REGWORD_STYLE_EUDC}
  788.   IME_REGWORD_STYLE_EUDC         = $00000001;
  789.   {$EXTERNALSYM IME_REGWORD_STYLE_USER_FIRST}
  790.   IME_REGWORD_STYLE_USER_FIRST   = $80000000;
  791.   {$EXTERNALSYM IME_REGWORD_STYLE_USER_LAST}
  792.   IME_REGWORD_STYLE_USER_LAST    = $FFFFFFFF;
  793.  
  794. { type of soft keyboard }
  795. { for Windows Tranditional Chinese Edition }
  796.   {$EXTERNALSYM SOFTKEYBOARD_TYPE_T1}
  797.   SOFTKEYBOARD_TYPE_T1           = $0001;
  798. { for Windows Simplified Chinese Edition }
  799.   {$EXTERNALSYM SOFTKEYBOARD_TYPE_C1}
  800.   SOFTKEYBOARD_TYPE_C1           = $0002;
  801.  
  802. const
  803.   imm32 = 'imm32.dll';
  804.  
  805. implementation
  806.  
  807. function ImmInstallIMEA; external imm32 name 'ImmInstallIMEA';
  808. function ImmInstallIMEW; external imm32 name 'ImmInstallIMEW';
  809. function ImmInstallIME; external imm32 name 'ImmInstallIMEA';
  810. function ImmGetDefaultIMEWnd; external imm32 name 'ImmGetDefaultIMEWnd';
  811. function ImmGetDescriptionA; external imm32 name 'ImmGetDescriptionA';
  812. function ImmGetDescriptionW; external imm32 name 'ImmGetDescriptionW';
  813. function ImmGetDescription; external imm32 name 'ImmGetDescriptionA';
  814. function ImmGetIMEFileNameA; external imm32 name 'ImmGetIMEFileNameA';
  815. function ImmGetIMEFileNameW; external imm32 name 'ImmGetIMEFileNameW';
  816. function ImmGetIMEFileName; external imm32 name 'ImmGetIMEFileNameA';
  817. function ImmGetProperty; external imm32 name 'ImmGetProperty';
  818. function ImmIsIME; external imm32 name 'ImmIsIME';
  819. function ImmSimulateHotKey; external imm32 name 'ImmSimulateHotKey';
  820. function ImmCreateContext; external imm32 name 'ImmCreateContext';
  821. function ImmDestroyContext; external imm32 name 'ImmDestroyContext';
  822. function ImmGetContext; external imm32 name 'ImmGetContext';
  823. function ImmReleaseContext; external imm32 name 'ImmReleaseContext';
  824. function ImmAssociateContext; external imm32 name 'ImmAssociateContext';
  825. function ImmGetCompositionStringA; external imm32 name 'ImmGetCompositionStringA';
  826. function ImmGetCompositionStringW; external imm32 name 'ImmGetCompositionStringW';
  827. function ImmGetCompositionString; external imm32 name 'ImmGetCompositionStringA';
  828. function ImmSetCompositionStringA; external imm32 name 'ImmSetCompositionStringA';
  829. function ImmSetCompositionStringW; external imm32 name 'ImmSetCompositionStringW';
  830. function ImmSetCompositionString; external imm32 name 'ImmSetCompositionStringA';
  831. function ImmGetCandidateListCountA; external imm32 name 'ImmGetCandidateListCountA';
  832. function ImmGetCandidateListCountW; external imm32 name 'ImmGetCandidateListCountW';
  833. function ImmGetCandidateListCount; external imm32 name 'ImmGetCandidateListCountA';
  834. function ImmGetCandidateListA; external imm32 name 'ImmGetCandidateListA';
  835. function ImmGetCandidateListW; external imm32 name 'ImmGetCandidateListW';
  836. function ImmGetCandidateList; external imm32 name 'ImmGetCandidateListA';
  837. function ImmGetGuideLineA; external imm32 name 'ImmGetGuideLineA';
  838. function ImmGetGuideLineW; external imm32 name 'ImmGetGuideLineW';
  839. function ImmGetGuideLine; external imm32 name 'ImmGetGuideLineA';
  840. function ImmGetConversionStatus; external imm32 name 'ImmGetConversionStatus';
  841. function ImmSetConversionStatus; external imm32 name 'ImmSetConversionStatus';
  842. function ImmGetOpenStatus; external imm32 name 'ImmGetOpenStatus';
  843. function ImmSetOpenStatus; external imm32 name 'ImmSetOpenStatus';
  844. function ImmGetCompositionFontA; external imm32 name 'ImmGetCompositionFontA';
  845. function ImmGetCompositionFontW; external imm32 name 'ImmGetCompositionFontW';
  846. function ImmGetCompositionFont; external imm32 name 'ImmGetCompositionFontA';
  847. function ImmSetCompositionFontA; external imm32 name 'ImmSetCompositionFontA';
  848. function ImmSetCompositionFontW; external imm32 name 'ImmSetCompositionFontW';
  849. function ImmSetCompositionFont; external imm32 name 'ImmSetCompositionFontA';
  850. function ImmConfigureIMEA; external imm32 name 'ImmConfigureIMEA';
  851. function ImmConfigureIMEW; external imm32 name 'ImmConfigureIMEW';
  852. function ImmConfigureIME; external imm32 name 'ImmConfigureIMEA';
  853. function ImmEscapeA; external imm32 name 'ImmEscapeA';
  854. function ImmEscapeW; external imm32 name 'ImmEscapeW';
  855. function ImmEscape; external imm32 name 'ImmEscapeA';
  856. function ImmGetConversionListA; external imm32 name 'ImmGetConversionListA';
  857. function ImmGetConversionListW; external imm32 name 'ImmGetConversionListW';
  858. function ImmGetConversionList; external imm32 name 'ImmGetConversionListA';
  859. function ImmNotifyIME; external imm32 name 'ImmNotifyIME';
  860. function ImmGetStatusWindowPos; external imm32 name 'ImmGetStatusWindowPos';
  861. function ImmSetStatusWindowPos; external imm32 name 'ImmSetStatusWindowPos';
  862. function ImmGetCompositionWindow; external imm32 name 'ImmGetCompositionWindow';
  863. function ImmSetCompositionWindow; external imm32 name 'ImmSetCompositionWindow';
  864. function ImmGetCandidateWindow; external imm32 name 'ImmGetCandidateWindow';
  865. function ImmSetCandidateWindow; external imm32 name 'ImmSetCandidateWindow';
  866. function ImmIsUIMessageA; external imm32 name 'ImmIsUIMessageA';
  867. function ImmIsUIMessageW; external imm32 name 'ImmIsUIMessageW';
  868. function ImmIsUIMessage; external imm32 name 'ImmIsUIMessageA';
  869. function ImmGetVirtualKey; external imm32 name 'ImmGetVirtualKey';
  870. function ImmRegisterWordA; external imm32 name 'ImmRegisterWordA';
  871. function ImmRegisterWordW; external imm32 name 'ImmRegisterWordW';
  872. function ImmRegisterWord; external imm32 name 'ImmRegisterWordA';
  873. function ImmUnregisterWordA; external imm32 name 'ImmUnregisterWordA';
  874. function ImmUnregisterWordW; external imm32 name 'ImmUnregisterWordW';
  875. function ImmUnregisterWord; external imm32 name 'ImmUnregisterWordA';
  876. function ImmGetRegisterWordStyleA; external imm32 name 'ImmGetRegisterWordStyleA';
  877. function ImmGetRegisterWordStyleW; external imm32 name 'ImmGetRegisterWordStyleW';
  878. function ImmGetRegisterWordStyle; external imm32 name 'ImmGetRegisterWordStyleA';
  879. function ImmEnumRegisterWordA; external imm32 name 'ImmEnumRegisterWordA';
  880. function ImmEnumRegisterWordW; external imm32 name 'ImmEnumRegisterWordW';
  881. function ImmEnumRegisterWord; external imm32 name 'ImmEnumRegisterWordA';
  882.  
  883. end.
  884.  
  885.