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