home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / borland / cb / setup / cbuilder / data.z / IMM.PAS < prev    next >
Pascal/Delphi Source File  |  1997-02-28  |  27KB  |  596 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Run-time Library                         }
  5. {       Windows 32bit API Interface Unit                }
  6. {                                                       }
  7. {       Copyright (c) 1996 Borland International        }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit Imm;
  12.  
  13. {$A+,Z+}
  14.  
  15. interface
  16.  
  17. uses Windows;
  18.  
  19. const
  20.   VK_PROCESSKEY = $E5;
  21.  
  22. type
  23.   HIMC = Integer;
  24.   {$nonamespace HIMC}
  25.  
  26.   PCompositionForm = ^TCompositionForm;
  27.   tagCOMPOSITIONFORM = record
  28.     dwStyle: DWORD;
  29.     ptCurrentPos: TPOINT;
  30.     rcArea: TRECT;
  31.   end;
  32.   {$nonamespace tagCOMPOSITIONFORM}
  33.   TCompositionForm = tagCOMPOSITIONFORM;
  34.  
  35.   PCandidateForm = ^TCandidateForm;
  36.   tagCANDIDATEFORM = record
  37.     dwIndex: DWORD;
  38.     dwStyle: DWORD;
  39.     ptCurrentPos: TPOINT;
  40.     rcArea: TRECT;
  41.   end;
  42.   {$nonamespace tagCANDIDATEFORM}
  43.   TCandidateForm = tagCANDIDATEFORM;
  44.  
  45.   PCandidateList = ^TCandidateList;
  46.   tagCANDIDATELIST = record
  47.     dwSize: DWORD;
  48.     dwStyle: DWORD;
  49.     dwCount: DWORD;
  50.     dwSelection: DWORD;
  51.     dwPageStart: DWORD;
  52.     dwPageSize: DWORD;
  53.     dwOffset: array[1..1] of DWORD;
  54.   end;
  55.   {$nonamespace tagCANDIDATELIST}
  56.   TCandidateList = tagCANDIDATELIST;
  57.  
  58.   PRegisterWordA = ^TRegisterWordA;
  59.   PRegisterWordW = ^TRegisterWordW;
  60.   PRegisterWord = PRegisterWordA;
  61.   tagREGISTERWORDA = record
  62.     lpReading: PAnsiChar;
  63.     lpWord: PAnsiChar;
  64.   end;
  65.   {$nonamespace tagREGISTERWORDA}
  66.   TRegisterWordA = tagREGISTERWORDA;
  67.   tagREGISTERWORDW = record
  68.     lpReading: PWideChar;
  69.     lpWord: PWideChar;
  70.   end;
  71.   {$nonamespace tagREGISTERWORDW}
  72.   TRegisterWordW = tagREGISTERWORDW;
  73.   TRegisterWord = TRegisterWordA;
  74.  
  75. const 
  76.   STYLE_DESCRIPTION_SIZE = 32;
  77.  
  78. type
  79.   PStyleBufA = ^TStyleBufA;
  80.   PStyleBufW = ^TStyleBufW;
  81.   PStyleBuf = PStyleBufA;
  82.   tagSTYLEBUFA = record
  83.     dwStyle: DWORD;
  84.     szDescription: array[0..STYLE_DESCRIPTION_SIZE-1] of AnsiChar; 
  85.   end;
  86.   {$nonamespace tagSTYLEBUFA}
  87.   TStyleBufA = tagSTYLEBUFA;
  88.   tagSTYLEBUFW = record
  89.     dwStyle: DWORD;
  90.     szDescription: array[0..STYLE_DESCRIPTION_SIZE-1] of WideChar; 
  91.   end;
  92.   {$nonamespace tagSTYLEBUFW}
  93.   TStyleBufW = tagSTYLEBUFW;
  94.   TStyleBuf = TStyleBufA;
  95.  
  96. { prototype of IMM API }
  97.  
  98. function ImmInstallIMEA(lpszIMEFileName, lpszLayoutText: PAnsiChar): HKL; stdcall;
  99. function ImmInstallIMEW(lpszIMEFileName, lpszLayoutText: PWideChar): HKL; stdcall;
  100. function ImmInstallIME(lpszIMEFileName, lpszLayoutText: PChar): HKL; stdcall;
  101.  
  102. function ImmGetDefaultIMEWnd(hWnd: HWND): HWND; stdcall;
  103.  
  104. function ImmGetDescriptionA(hKl: HKL; PAnsiChar: PAnsiChar; uBufLen: UINT): UINT; stdcall;
  105. function ImmGetDescriptionW(hKl: HKL; PWideChar: PWideChar; uBufLen: UINT): UINT; stdcall;
  106. function ImmGetDescription(hKl: HKL; PChar: PChar; uBufLen: UINT): UINT; stdcall;
  107.  
  108. function ImmGetIMEFileNameA(hKl: HKL; PAnsiChar: PAnsiChar; uBufLen: UINT): UINT; stdcall;
  109. function ImmGetIMEFileNameW(hKl: HKL; PWideChar: PWideChar; uBufLen: UINT): UINT; stdcall;
  110. function ImmGetIMEFileName(hKl: HKL; PChar: PChar; uBufLen: UINT): UINT; stdcall;
  111.  
  112. function ImmGetProperty(hKl: HKL; dWord: DWORD): DWORD; stdcall;
  113.  
  114. function ImmIsIME(hKl: HKL): Boolean; stdcall;
  115.  
  116. function ImmSimulateHotKey(hWnd: HWND; dWord: DWORD): Boolean; stdcall;
  117.  
  118. function ImmCreateContext: HIMC; stdcall;
  119. function ImmDestroyContext(hImc: HIMC): Boolean; stdcall;
  120. function ImmGetContext(hWnd: HWND): HIMC; stdcall;
  121. function ImmReleaseContext(hWnd: HWND; hImc: HIMC): Boolean; stdcall;
  122. function ImmAssociateContext(hWnd: HWND; hImc: HIMC): HIMC; stdcall;
  123.  
  124. function ImmGetCompositionStringA(hImc: HIMC; dWord1: DWORD; lpBuf: pointer; dwBufLen: DWORD): Longint; stdcall;
  125. function ImmGetCompositionStringW(hImc: HIMC; dWord1: DWORD; lpBuf: pointer; dwBufLen: DWORD): Longint; stdcall;
  126. function ImmGetCompositionString(hImc: HIMC; dWord1: DWORD; lpBuf: pointer; dwBufLen: DWORD): Longint; stdcall;
  127.  
  128. function ImmSetCompositionStringA(hImc: HIMC; dwIndex: DWORD; lpComp: pointer; dwCompLen: DWORD; lpRead: pointer; dwReadLen: DWORD):Boolean; stdcall;
  129. function ImmSetCompositionStringW(hImc: HIMC; dwIndex: DWORD; lpComp: pointer; dwCompLen: DWORD; lpRead: pointer; dwReadLen: DWORD):Boolean; stdcall;
  130. function ImmSetCompositionString(hImc: HIMC; dwIndex: DWORD; lpComp: pointer; dwCompLen: DWORD; lpRead: pointer; dwReadLen: DWORD):Boolean; stdcall;
  131.  
  132. function ImmGetCandidateListCountA(hImc: HIMC; var ListCount: DWORD): DWORD; stdcall;
  133. function ImmGetCandidateListCountW(hImc: HIMC; var ListCount: DWORD): DWORD; stdcall;
  134. function ImmGetCandidateListCount(hImc: HIMC; var ListCount: DWORD): DWORD; stdcall;
  135.  
  136. function ImmGetCandidateListA(hImc: HIMC; deIndex: DWORD; lpCandidateList: PCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall;
  137. function ImmGetCandidateListW(hImc: HIMC; deIndex: DWORD; lpCandidateList: PCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall;
  138. function ImmGetCandidateList(hImc: HIMC; deIndex: DWORD; lpCandidateList: PCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall;
  139.  
  140. function ImmGetGuideLineA(hImc: HIMC; dwIndex: DWORD; lpBuf: PAnsiChar; dwBufLen: DWORD): DWORD; stdcall;
  141. function ImmGetGuideLineW(hImc: HIMC; dwIndex: DWORD; lpBuf: PWideChar; dwBufLen: DWORD): DWORD; stdcall;
  142. function ImmGetGuideLine(hImc: HIMC; dwIndex: DWORD; lpBuf: PChar; dwBufLen: DWORD): DWORD; stdcall;
  143.  
  144. function ImmGetConversionStatus(hImc: HIMC; var Conversion, Sentence: DWORD): Boolean; stdcall;
  145. function ImmSetConversionStatus(hImc: HIMC; Conversion, Sentence: DWORD): Boolean; stdcall;
  146. function ImmGetOpenStatus(hImc: HIMC): Boolean; stdcall;
  147. function ImmSetOpenStatus(hImc: HIMC; fOpen: Boolean): Boolean; stdcall;
  148.  
  149. function ImmGetCompositionFontA(hImc: HIMC; lpLogfont: PLOGFONTA): Boolean; stdcall;
  150. function ImmGetCompositionFontW(hImc: HIMC; lpLogfont: PLOGFONTW): Boolean; stdcall;
  151. function ImmGetCompositionFont(hImc: HIMC; lpLogfont: PLOGFONT): Boolean; stdcall;
  152.  
  153. function ImmSetCompositionFontA(hImc: HIMC; lpLogfont: PLOGFONTA): Boolean; stdcall;
  154. function ImmSetCompositionFontW(hImc: HIMC; lpLogfont: PLOGFONTW): Boolean; stdcall;
  155. function ImmSetCompositionFont(hImc: HIMC; lpLogfont: PLOGFONT): Boolean; stdcall;
  156.  
  157. function ImmConfigureIMEA(hKl: HKL; hWnd: HWND; dwMode: DWORD; lpData: pointer): Boolean; stdcall;
  158. function ImmConfigureIMEW(hKl: HKL; hWnd: HWND; dwMode: DWORD; lpData: pointer): Boolean; stdcall;
  159. function ImmConfigureIME(hKl: HKL; hWnd: HWND; dwMode: DWORD; lpData: pointer): Boolean; stdcall;
  160.  
  161. function ImmEscapeA(hKl: HKL; hImc: HIMC; uEscape: UINT; lpData: pointer): LRESULT; stdcall;
  162. function ImmEscapeW(hKl: HKL; hImc: HIMC; uEscape: UINT; lpData: pointer): LRESULT; stdcall;
  163. function ImmEscape(hKl: HKL; hImc: HIMC; uEscape: UINT; lpData: pointer): LRESULT; stdcall;
  164.  
  165. function ImmGetConversionListA(hKl: HKL; hImc: HIMC; lpSrc: PAnsiChar; lpDst: PCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT ): DWORD; stdcall;
  166. function ImmGetConversionListW(hKl: HKL; hImc: HIMC; lpSrc: PWideChar; lpDst: PCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT ): DWORD; stdcall;
  167. function ImmGetConversionList(hKl: HKL; hImc: HIMC; lpSrc: PChar; lpDst: PCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT ): DWORD; stdcall;
  168.  
  169. function ImmNotifyIME(hImc: HIMC; dwAction, dwIndex, dwValue: DWORD): Boolean; stdcall;
  170.  
  171. function ImmGetStatusWindowPos(hImc: HIMC; var lpPoint : TPoint): Boolean; stdcall;
  172. function ImmSetStatusWindowPos(hImc: HIMC; lpPoint: PPOINT): Boolean; stdcall;
  173. function ImmGetCompositionWindow(hImc: HIMC; lpCompForm: PCOMPOSITIONFORM): Boolean; stdcall;
  174. function ImmSetCompositionWindow(hImc: HIMC; lpCompForm: PCOMPOSITIONFORM): Boolean; stdcall;
  175. function ImmGetCandidateWindow(hImc: HIMC; dwBufLen: DWORD; lpCandidate: PCANDIDATEFORM): Boolean; stdcall;
  176. function ImmSetCandidateWindow(hImc: HIMC; lpCandidate: PCANDIDATEFORM): Boolean; stdcall;
  177.  
  178. function ImmIsUIMessageA(hWnd: HWND; msg: UINT; wParam: WPARAM; lParam: LPARAM): Boolean; stdcall;
  179. function ImmIsUIMessageW(hWnd: HWND; msg: UINT; wParam: WPARAM; lParam: LPARAM): Boolean; stdcall;
  180. function ImmIsUIMessage(hWnd: HWND; msg: UINT; wParam: WPARAM; lParam: LPARAM): Boolean; stdcall;
  181.  
  182. function ImmGetVirtualKey(hWnd: HWND): UINT; stdcall;
  183.  
  184. type
  185.   RegisterWordEnumProcA = Function(lpReading: PAnsiChar; dwStyle: DWORD; lpszString: PAnsiChar; lpData: pointer): integer;
  186.   RegisterWordEnumProcW = Function(lpReading: PWideChar; dwStyle: DWORD; lpszString: PWideChar; lpData: pointer): integer;
  187.   RegisterWordEnumProc = RegisterWordEnumProcA;
  188.  
  189. function ImmRegisterWordA(hKl: HKL; lpszReading: PAnsiChar; dwStyle: DWORD; lpszRegister: PAnsiChar): Boolean; stdcall;
  190. function ImmRegisterWordW(hKl: HKL; lpszReading: PWideChar; dwStyle: DWORD; lpszRegister: PWideChar): Boolean; stdcall;
  191. function ImmRegisterWord(hKl: HKL; lpszReading: PChar; dwStyle: DWORD; lpszRegister: PChar): Boolean; stdcall;
  192.  
  193. function ImmUnregisterWordA(hKl: HKL; lpszReading: PAnsiChar; dwStyle: DWORD; lpszUnregister: PAnsiChar): Boolean; stdcall;
  194. function ImmUnregisterWordW(hKl: HKL; lpszReading: PWideChar; dwStyle: DWORD; lpszUnregister: PWideChar): Boolean; stdcall;
  195. function ImmUnregisterWord(hKl: HKL; lpszReading: PChar; dwStyle: DWORD; lpszUnregister: PChar): Boolean; stdcall;
  196.  
  197. function ImmGetRegisterWordStyleA(hKl: HKL; nItem: UINT; lpStyleBuf: PSTYLEBUFA): UINT; stdcall;
  198. function ImmGetRegisterWordStyleW(hKl: HKL; nItem: UINT; lpStyleBuf: PSTYLEBUFW): UINT; stdcall;
  199. function ImmGetRegisterWordStyle(hKl: HKL; nItem: UINT; lpStyleBuf: PSTYLEBUF): UINT; stdcall;
  200.  
  201. function ImmEnumRegisterWordA(hKl: HKL; lpfnEnumProc: REGISTERWORDENUMPROCA; lpszReading: PAnsiChar; dwStyle: DWORD; lpszRegister: PAnsiChar; lpData : pointer): UINT; stdcall;
  202. function ImmEnumRegisterWordW(hKl: HKL; lpfnEnumProc: REGISTERWORDENUMPROCW; lpszReading: PWideChar; dwStyle: DWORD; lpszRegister: PWideChar; lpData : pointer): UINT; stdcall;
  203. function ImmEnumRegisterWord(hKl: HKL; lpfnEnumProc: REGISTERWORDENUMPROC; lpszReading: PChar; dwStyle: DWORD; lpszRegister: PChar; lpData : pointer): UINT; stdcall;
  204.  
  205. const
  206. { the IME related messages }
  207.   WM_CONVERTREQUESTEX            = $0108;
  208.   WM_IME_STARTCOMPOSITION        = $010D;
  209.   WM_IME_ENDCOMPOSITION          = $010E;
  210.   WM_IME_COMPOSITION             = $010F;
  211.   WM_IME_KEYLAST                 = $010F;
  212.  
  213.   WM_IME_SETCONTEXT              = $0281;
  214.   WM_IME_NOTIFY                  = $0282;
  215.   WM_IME_CONTROL                 = $0283;
  216.   WM_IME_COMPOSITIONFULL         = $0284;
  217.   WM_IME_SELECT                  = $0285;
  218.   WM_IME_CHAR                    = $0286;
  219.  
  220.   WM_IME_KEYDOWN                 = $0290;
  221.   WM_IME_KEYUP                   = $0291;
  222.  
  223. { wParam for WM_IME_CONTROL }
  224.   IMC_GETCANDIDATEPOS            = $0007;
  225.   IMC_SETCANDIDATEPOS            = $0008;
  226.   IMC_GETCOMPOSITIONFONT         = $0009;
  227.   IMC_SETCOMPOSITIONFONT         = $000A;
  228.   IMC_GETCOMPOSITIONWINDOW       = $000B;
  229.   IMC_SETCOMPOSITIONWINDOW       = $000C;
  230.   IMC_GETSTATUSWINDOWPOS         = $000F;
  231.   IMC_SETSTATUSWINDOWPOS         = $0010;
  232.   IMC_CLOSESTATUSWINDOW          = $0021;
  233.   IMC_OPENSTATUSWINDOW           = $0022;
  234.  
  235. { wParam for WM_IME_CONTROL to the soft keyboard }
  236. { dwAction for ImmNotifyIME }
  237.   NI_OPENCANDIDATE               = $0010;
  238.   NI_CLOSECANDIDATE              = $0011;
  239.   NI_SELECTCANDIDATESTR          = $0012;
  240.   NI_CHANGECANDIDATELIST         = $0013;
  241.   NI_FINALIZECONVERSIONRESULT    = $0014;
  242.   NI_COMPOSITIONSTR              = $0015;
  243.   NI_SETCANDIDATE_PAGESTART      = $0016;
  244.   NI_SETCANDIDATE_PAGESIZE       = $0017;
  245.  
  246. { lParam for WM_IME_SETCONTEXT }
  247.   ISC_SHOWUICANDIDATEWINDOW      = $00000001;
  248.   ISC_SHOWUICOMPOSITIONWINDOW    = $80000000;
  249.   ISC_SHOWUIGUIDELINE            = $40000000;
  250.   ISC_SHOWUIALLCANDIDATEWINDOW   = $0000000F;
  251.   ISC_SHOWUIALL                  = $C000000F;
  252.  
  253. { dwIndex for ImmNotifyIME/NI_COMPOSITIONSTR }
  254.   CPS_COMPLETE                   = $0001;
  255.   CPS_CONVERT                    = $0002;
  256.   CPS_REVERT                     = $0003;
  257.   CPS_CANCEL                     = $0004;
  258.  
  259. { the modifiers of hot key }
  260.   MOD_ALT                        = $0001;
  261.   MOD_CONTROL                    = $0002;
  262.   MOD_SHIFT                      = $0004;
  263.  
  264.   MOD_LEFT                       = $8000;
  265.   MOD_RIGHT                      = $4000;
  266.  
  267.   MOD_ON_KEYUP                   = $0800;
  268.   MOD_IGNORE_ALL_MODIFIER        = $0400;
  269.  
  270. { Windows for Simplified Chinese Edition hot key ID from #10 - #2F }
  271.   IME_CHOTKEY_IME_NONIME_TOGGLE          = $10;
  272.   IME_CHOTKEY_SHAPE_TOGGLE               = $11;
  273.   IME_CHOTKEY_SYMBOL_TOGGLE              = $12;
  274.  
  275. { Windows for Japanese Edition hot key ID from #30 - #4F }
  276.   IME_JHOTKEY_CLOSE_OPEN                 = $30;
  277.  
  278. { Windows for Korean Edition hot key ID from #50 - #6F }
  279.   IME_KHOTKEY_SHAPE_TOGGLE               = $50;
  280.   IME_KHOTKEY_HANJACONVERT               = $51;
  281.   IME_KHOTKEY_ENGLISH                    = $52;
  282.  
  283. { Windows for Tranditional Chinese Edition hot key ID from #70 - #8F }
  284.   IME_THOTKEY_IME_NONIME_TOGGLE          = $70;
  285.   IME_THOTKEY_SHAPE_TOGGLE               = $71;
  286.   IME_THOTKEY_SYMBOL_TOGGLE              = $72;
  287.  
  288. { direct switch hot key ID from #100 - #11F }
  289.   IME_HOTKEY_DSWITCH_FIRST               = $100;
  290.   IME_HOTKEY_DSWITCH_LAST                = $11F;
  291.  
  292. { IME private hot key from #200 - #21F }
  293.   IME_ITHOTKEY_RESEND_RESULTSTR          = $200;
  294.   IME_ITHOTKEY_PREVIOUS_COMPOSITION      = $201;
  295.   IME_ITHOTKEY_UISTYLE_TOGGLE            = $202;
  296.  
  297. { parameter of ImmGetCompositionString }
  298.   GCS_COMPREADSTR                = $0001;
  299.   GCS_COMPREADATTR               = $0002;
  300.   GCS_COMPREADCLAUSE             = $0004;
  301.   GCS_COMPSTR                    = $0008;
  302.   GCS_COMPATTR                   = $0010;
  303.   GCS_COMPCLAUSE                 = $0020;
  304.   GCS_CURSORPOS                  = $0080;
  305.   GCS_DELTASTART                 = $0100;
  306.   GCS_RESULTREADSTR              = $0200;
  307.   GCS_RESULTREADCLAUSE           = $0400;
  308.   GCS_RESULTSTR                  = $0800;
  309.   GCS_RESULTCLAUSE               = $1000;
  310.  
  311. { style bit flags for WM_IME_COMPOSITION }
  312.   CS_INSERTCHAR                  = $2000;
  313.   CS_NOMOVECARET                 = $4000;
  314.  
  315. { bits of fdwInit of INPUTCONTEXT }
  316. { IME version constants }
  317.   IMEVER_0310                    = $0003000A;
  318.   IMEVER_0400                    = $00040000;
  319.  
  320. { IME property bits }
  321.   IME_PROP_AT_CARET              = $00010000;
  322.   IME_PROP_SPECIAL_UI            = $00020000;
  323.   IME_PROP_CANDLIST_START_FROM_1 = $00040000;
  324.   IME_PROP_UNICODE               = $00080000;
  325.  
  326. { IME UICapability bits }
  327.   UI_CAP_2700                    = $00000001;
  328.   UI_CAP_ROT90                   = $00000002;
  329.   UI_CAP_ROTANY                  = $00000004;
  330.  
  331. { ImmSetCompositionString Capability bits }
  332.   SCS_CAP_COMPSTR                = $00000001;
  333.   SCS_CAP_MAKEREAD               = $00000002;
  334.  
  335. { IME WM_IME_SELECT inheritance Capability bits }
  336.   SELECT_CAP_CONVERSION          = $00000001;
  337.   SELECT_CAP_SENTENCE            = $00000002;
  338.  
  339. { ID for deIndex of ImmGetGuideLine }
  340.   GGL_LEVEL                      = $00000001;
  341.   GGL_INDEX                      = $00000002;
  342.   GGL_STRING                     = $00000003;
  343.   GGL_PRIVATE                    = $00000004;
  344.  
  345. { ID for dwLevel of GUIDELINE Structure }
  346.   GL_LEVEL_NOGUIDELINE           = $00000000;
  347.   GL_LEVEL_FATAL                 = $00000001;
  348.   GL_LEVEL_ERROR                 = $00000002;
  349.   GL_LEVEL_WARNING               = $00000003;
  350.   GL_LEVEL_INFORMATION           = $00000004;
  351.  
  352. { ID for dwIndex of GUIDELINE Structure }
  353.   GL_ID_UNKNOWN                  = $00000000;
  354.   GL_ID_NOMODULE                 = $00000001;
  355.   GL_ID_NODICTIONARY             = $00000010;
  356.   GL_ID_CANNOTSAVE               = $00000011;
  357.   GL_ID_NOCONVERT                = $00000020;
  358.   GL_ID_TYPINGERROR              = $00000021;
  359.   GL_ID_TOOMANYSTROKE            = $00000022;
  360.   GL_ID_READINGCONFLICT          = $00000023;
  361.   GL_ID_INPUTREADING             = $00000024;
  362.   GL_ID_INPUTRADICAL             = $00000025;
  363.   GL_ID_INPUTCODE                = $00000026;
  364.   GL_ID_INPUTSYMBOL              = $00000027;
  365.   GL_ID_CHOOSECANDIDATE          = $00000028;
  366.   GL_ID_REVERSECONVERSION        = $00000029;
  367.   GL_ID_PRIVATE_FIRST            = $00008000;
  368.   GL_ID_PRIVATE_LAST             = $0000FFFF;
  369.  
  370. { ID for dwIndex of ImmGetProperty }
  371.   IGP_GETIMEVERSION              = 4;
  372.   IGP_PROPERTY                   = $00000004;
  373.   IGP_CONVERSION                 = $00000008;
  374.   IGP_SENTENCE                   = $0000000c;
  375.   IGP_UI                         = $00000010;
  376.   IGP_SETCOMPSTR                 = $00000014;
  377.   IGP_SELECT                     = $00000018;
  378.  
  379. { dwIndex for ImmSetCompositionString API }
  380.   SCS_SETSTR                     = (GCS_COMPREADSTR or GCS_COMPSTR);
  381.   SCS_CHANGEATTR                 = (GCS_COMPREADATTR or GCS_COMPATTR);
  382.   SCS_CHANGECLAUSE               = (GCS_COMPREADCLAUSE or GCS_COMPCLAUSE);
  383.  
  384. { attribute for COMPOSITIONSTRING Structure }
  385.   ATTR_INPUT                     = $00;
  386.   ATTR_TARGET_CONVERTED          = $01;
  387.   ATTR_CONVERTED                 = $02;
  388.   ATTR_TARGET_NOTCONVERTED       = $03;
  389.   ATTR_INPUT_ERROR               = $04;
  390.  
  391. { bit field for IMC_SETCOMPOSITIONWINDOW, IMC_SETCANDIDATEWINDOW }
  392.   CFS_DEFAULT                    = $0000;
  393.   CFS_RECT                       = $0001;
  394.   CFS_POINT                      = $0002;
  395.   CFS_SCREEN                     = $0004;
  396.   CFS_FORCE_POSITION             = $0020;
  397.   CFS_CANDIDATEPOS               = $0040;
  398.   CFS_EXCLUDE                    = $0080;
  399.  
  400. { conversion direction for ImmGetConversionList }
  401.   GCL_CONVERSION                 = $0001;
  402.   GCL_REVERSECONVERSION          = $0002;
  403.   GCL_REVERSE_LENGTH             = $0003;
  404.  
  405. { bit field for conversion mode }
  406.   IME_CMODE_ALPHANUMERIC         = $0000;
  407.   IME_CMODE_NATIVE               = $0001;
  408.   IME_CMODE_CHINESE              = IME_CMODE_NATIVE;
  409.   IME_CMODE_HANGEUL              = IME_CMODE_NATIVE;
  410.   IME_CMODE_JAPANESE             = IME_CMODE_NATIVE;
  411.   IME_CMODE_KATAKANA             = $0002;  { effective only under IME_CMODE_NATIVE}
  412.   IME_CMODE_LANGUAGE             = $0003;
  413.   IME_CMODE_FULLSHAPE            = $0008;
  414.   IME_CMODE_ROMAN                = $0010;
  415.   IME_CMODE_CHARCODE             = $0020;
  416.   IME_CMODE_HANJACONVERT         = $0040;
  417.   IME_CMODE_SOFTKBD              = $0080;
  418.   IME_CMODE_NOCONVERSION         = $0100;
  419.   IME_CMODE_EUDC                 = $0200;
  420.   IME_CMODE_SYMBOL               = $0400;
  421.  
  422.   IME_SMODE_NONE                 = $0000;
  423.   IME_SMODE_PLAURALCLAUSE        = $0001;
  424.   IME_SMODE_SINGLECONVERT        = $0002;
  425.   IME_SMODE_AUTOMATIC            = $0004;
  426.   IME_SMODE_PHRASEPREDICT        = $0008;
  427.  
  428. { style of candidate }
  429.   IME_CAND_UNKNOWN               = $0000;
  430.   IME_CAND_READ                  = $0001;
  431.   IME_CAND_CODE                  = $0002;
  432.   IME_CAND_MEANING               = $0003;
  433.   IME_CAND_RADICAL               = $0004;
  434.   IME_CAND_STROKE                = $0005;
  435.  
  436. { wParam of report message WM_IME_NOTIFY }
  437.   IMN_CLOSESTATUSWINDOW          = $0001;
  438.   IMN_OPENSTATUSWINDOW           = $0002;
  439.   IMN_CHANGECANDIDATE            = $0003;
  440.   IMN_CLOSECANDIDATE             = $0004;
  441.   IMN_OPENCANDIDATE              = $0005;
  442.   IMN_SETCONVERSIONMODE          = $0006;
  443.   IMN_SETSENTENCEMODE            = $0007;
  444.   IMN_SETOPENSTATUS              = $0008;
  445.   IMN_SETCANDIDATEPOS            = $0009;
  446.   IMN_SETCOMPOSITIONFONT         = $000A;
  447.   IMN_SETCOMPOSITIONWINDOW       = $000B;
  448.   IMN_SETSTATUSWINDOWPOS         = $000C;
  449.   IMN_GUIDELINE                  = $000D;
  450.   IMN_PRIVATE                    = $000E;
  451.  
  452. { error code of ImmGetCompositionString }
  453.   IMM_ERROR_NODATA               = -1;
  454.   IMM_ERROR_GENERAL              = -2;
  455.  
  456. { dialog mode of ImmConfigureIME }
  457.   IME_CONFIG_GENERAL             = 1;
  458.   IME_CONFIG_REGISTERWORD        = 2;
  459.   IME_CONFIG_SELECTDICTIONARY    = 3;
  460.  
  461. { dialog mode of ImmEscape }
  462.   IME_ESC_QUERY_SUPPORT          = $0003;
  463.   IME_ESC_RESERVED_FIRST         = $0004;
  464.   IME_ESC_RESERVED_LAST          = $07FF;
  465.   IME_ESC_PRIVATE_FIRST          = $0800;
  466.   IME_ESC_PRIVATE_LAST           = $0FFF;
  467.   IME_ESC_SEQUENCE_TO_INTERNAL   = $1001;
  468.   IME_ESC_GET_EUDC_DICTIONARY    = $1003;
  469.   IME_ESC_SET_EUDC_DICTIONARY    = $1004;
  470.   IME_ESC_MAX_KEY                = $1005;
  471.   IME_ESC_IME_NAME               = $1006;
  472.   IME_ESC_SYNC_HOTKEY            = $1007;
  473.   IME_ESC_HANJA_MODE             = $1008;
  474.   IME_ESC_AUTOMATA               = $1009;
  475.  
  476. { style of word registration }
  477.   IME_REGWORD_STYLE_EUDC         = $00000001;
  478.   IME_REGWORD_STYLE_USER_FIRST   = $80000000;
  479.   IME_REGWORD_STYLE_USER_LAST    = $FFFFFFFF;
  480.  
  481. { type of soft keyboard }
  482. { for Windows Tranditional Chinese Edition }
  483.   SOFTKEYBOARD_TYPE_T1           = $0001;
  484. { for Windows Simplified Chinese Edition }
  485.   SOFTKEYBOARD_TYPE_C1           = $0002;
  486.  
  487. const
  488.   imm32 = 'imm32.dll';
  489.  
  490. implementation
  491.  
  492. function ImmInstallIMEA; external imm32 name 'ImmInstallIMEA';
  493. function ImmInstallIMEW; external imm32 name 'ImmInstallIMEW';
  494. function ImmInstallIME; external imm32 name 'ImmInstallIMEA';
  495.  
  496. function ImmGetDefaultIMEWnd; external imm32 name 'ImmGetDefaultIMEWnd{%}';
  497.  
  498. function ImmGetDescriptionA; external imm32 name 'ImmGetDescriptionA';
  499. function ImmGetDescriptionW; external imm32 name 'ImmGetDescriptionW';
  500. function ImmGetDescription; external imm32 name 'ImmGetDescriptionA';
  501.  
  502. function ImmGetIMEFileNameA; external imm32 name 'ImmGetIMEFileNameA';
  503. function ImmGetIMEFileNameW; external imm32 name 'ImmGetIMEFileNameW';
  504. function ImmGetIMEFileName; external imm32 name 'ImmGetIMEFileNameA';
  505.  
  506. function ImmGetProperty; external imm32 name 'ImmGetProperty';
  507.  
  508. function ImmIsIME; external imm32 name 'ImmIsIME';
  509.  
  510. function ImmSimulateHotKey; external imm32 name 'ImmSimulateHotKey';
  511.  
  512. function ImmCreateContext; external imm32 name 'ImmCreateContext';
  513. function ImmDestroyContext; external imm32 name 'ImmDestroyContext';
  514. function ImmGetContext; external imm32 name 'ImmGetContext';
  515. function ImmReleaseContext; external imm32 name 'ImmReleaseContext';
  516. function ImmAssociateContext; external imm32 name 'ImmAssociateContext';
  517.  
  518. function ImmGetCompositionStringA; external imm32 name 'ImmGetCompositionStringA';
  519. function ImmGetCompositionStringW; external imm32 name 'ImmGetCompositionStringW';
  520. function ImmGetCompositionString; external imm32 name 'ImmGetCompositionStringA';
  521.  
  522. function ImmSetCompositionStringA; external imm32 name 'ImmSetCompositionStringA';
  523. function ImmSetCompositionStringW; external imm32 name 'ImmSetCompositionStringW';
  524. function ImmSetCompositionString; external imm32 name 'ImmSetCompositionStringA';
  525.  
  526. function ImmGetCandidateListCountA; external imm32 name 'ImmGetCandidateListCountA';
  527. function ImmGetCandidateListCountW; external imm32 name 'ImmGetCandidateListCountW';
  528. function ImmGetCandidateListCount; external imm32 name 'ImmGetCandidateListCountA';
  529.  
  530. function ImmGetCandidateListA; external imm32 name 'ImmGetCandidateListA';
  531. function ImmGetCandidateListW; external imm32 name 'ImmGetCandidateListW';
  532. function ImmGetCandidateList; external imm32 name 'ImmGetCandidateListA';
  533.  
  534. function ImmGetGuideLineA; external imm32 name 'ImmGetGuideLineA';
  535. function ImmGetGuideLineW; external imm32 name 'ImmGetGuideLineW';
  536. function ImmGetGuideLine; external imm32 name 'ImmGetGuideLineA';
  537.  
  538. function ImmGetConversionStatus; external imm32 name 'ImmGetConversionStatus';
  539. function ImmSetConversionStatus; external imm32 name 'ImmSetConversionStatus';
  540. function ImmGetOpenStatus; external imm32 name 'ImmGetOpenStatus';
  541. function ImmSetOpenStatus; external imm32 name 'ImmSetOpenStatus';
  542.  
  543. function ImmGetCompositionFontA; external imm32 name 'ImmGetCompositionFontA';
  544. function ImmGetCompositionFontW; external imm32 name 'ImmGetCompositionFontW';
  545. function ImmGetCompositionFont; external imm32 name 'ImmGetCompositionFontA';
  546.  
  547. function ImmSetCompositionFontA; external imm32 name 'ImmSetCompositionFontA';
  548. function ImmSetCompositionFontW; external imm32 name 'ImmSetCompositionFontW';
  549. function ImmSetCompositionFont; external imm32 name 'ImmSetCompositionFontA';
  550.  
  551. function ImmConfigureIMEA; external imm32 name 'ImmConfigureIMEA';
  552. function ImmConfigureIMEW; external imm32 name 'ImmConfigureIMEW';
  553. function ImmConfigureIME; external imm32 name 'ImmConfigureIMEA';
  554.  
  555. function ImmEscapeA; external imm32 name 'ImmEscapeA';
  556. function ImmEscapeW; external imm32 name 'ImmEscapeW';
  557. function ImmEscape; external imm32 name 'ImmEscapeA';
  558.  
  559. function ImmGetConversionListA; external imm32 name 'ImmGetConversionListA';
  560. function ImmGetConversionListW; external imm32 name 'ImmGetConversionListW';
  561. function ImmGetConversionList; external imm32 name 'ImmGetConversionListA';
  562.  
  563. function ImmNotifyIME; external imm32 name 'ImmNotifyIME';
  564.  
  565. function ImmGetStatusWindowPos; external imm32 name 'ImmGetStatusWindowPos';
  566. function ImmSetStatusWindowPos; external imm32 name 'ImmSetStatusWindowPos';
  567. function ImmGetCompositionWindow; external imm32 name 'ImmGetCompositionWindow';
  568. function ImmSetCompositionWindow; external imm32 name 'ImmSetCompositionWindow';
  569. function ImmGetCandidateWindow; external imm32 name 'ImmGetCandidateWindow';
  570. function ImmSetCandidateWindow; external imm32 name 'ImmSetCandidateWindow';
  571.  
  572. function ImmIsUIMessageA; external imm32 name 'ImmIsUIMessageA';
  573. function ImmIsUIMessageW; external imm32 name 'ImmIsUIMessageW';
  574. function ImmIsUIMessage; external imm32 name 'ImmIsUIMessageA';
  575.  
  576. function ImmGetVirtualKey; external imm32 name 'ImmGetVirtualKey';
  577.  
  578. function ImmRegisterWordA; external imm32 name 'ImmRegisterWordA';
  579. function ImmRegisterWordW; external imm32 name 'ImmRegisterWordW';
  580. function ImmRegisterWord; external imm32 name 'ImmRegisterWordA';
  581.  
  582. function ImmUnregisterWordA; external imm32 name 'ImmUnregisterWordA';
  583. function ImmUnregisterWordW; external imm32 name 'ImmUnregisterWordW';
  584. function ImmUnregisterWord; external imm32 name 'ImmUnregisterWordA';
  585.  
  586. function ImmGetRegisterWordStyleA; external imm32 name 'ImmGetRegisterWordStyleA';
  587. function ImmGetRegisterWordStyleW; external imm32 name 'ImmGetRegisterWordStyleW';
  588. function ImmGetRegisterWordStyle; external imm32 name 'ImmGetRegisterWordStyleA';
  589.  
  590. function ImmEnumRegisterWordA; external imm32 name 'ImmEnumRegisterWordA';
  591. function ImmEnumRegisterWordW; external imm32 name 'ImmEnumRegisterWordW';
  592. function ImmEnumRegisterWord; external imm32 name 'ImmEnumRegisterWordA';
  593.  
  594. end.
  595.  
  596.