home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 August / VPR9608A.BIN / del20try / install / data.z / IMM.PAS < prev    next >
Pascal/Delphi Source File  |  1996-05-08  |  26KB  |  585 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. {check! }
  176.  
  177. function ImmRegisterWordA(hKl: HKL; lpszReading: PAnsiChar; dwStyle: DWORD; lpszRegister: PAnsiChar): Boolean; stdcall;
  178. function ImmRegisterWordW(hKl: HKL; lpszReading: PWideChar; dwStyle: DWORD; lpszRegister: PWideChar): Boolean; stdcall;
  179. function ImmRegisterWord(hKl: HKL; lpszReading: PChar; dwStyle: DWORD; lpszRegister: PChar): Boolean; stdcall;
  180.  
  181. function ImmUnregisterWordA( hKl: HKL; lpszReading: PAnsiChar; dwStyle: DWORD; lpszUnregister: PAnsiChar):boolean; stdcall;
  182. function ImmUnregisterWordW( hKl: HKL; lpszReading: PWideChar; dwStyle: DWORD; lpszUnregister: PWideChar):boolean; stdcall;
  183. function ImmUnregisterWord( hKl: HKL; lpszReading: PChar; dwStyle: DWORD; lpszUnregister: PChar):boolean; stdcall;
  184.  
  185. function ImmGetRegisterWordStyleA( hKl: HKL; nItem: UINT; lpStyleBuf: PSTYLEBUFA):UINT; stdcall;
  186. function ImmGetRegisterWordStyleW( hKl: HKL; nItem: UINT; lpStyleBuf: PSTYLEBUFW):UINT; stdcall;
  187. function ImmGetRegisterWordStyle( hKl: HKL; nItem: UINT; lpStyleBuf: PSTYLEBUF):UINT; stdcall;
  188.  
  189. function ImmEnumRegisterWordA(hKl: HKL; lpfnEnumProc: REGISTERWORDENUMPROCA; lpszReading: PAnsiChar; dwStyle: DWORD; lpszRegister: PAnsiChar; lpData : pointer): UINT; stdcall;
  190. function ImmEnumRegisterWordW(hKl: HKL; lpfnEnumProc: REGISTERWORDENUMPROCW; lpszReading: PWideChar; dwStyle: DWORD; lpszRegister: PWideChar; lpData : pointer): UINT; stdcall;
  191. function ImmEnumRegisterWord(hKl: HKL; lpfnEnumProc: REGISTERWORDENUMPROC; lpszReading: PChar; dwStyle: DWORD; lpszRegister: PChar; lpData : pointer): UINT; stdcall;
  192.  
  193. const
  194. { the IME related messages }
  195.   WM_CONVERTREQUESTEX            = $0108;
  196.   WM_IME_STARTCOMPOSITION        = $010D;
  197.   WM_IME_ENDCOMPOSITION          = $010E;
  198.   WM_IME_COMPOSITION             = $010F;
  199.   WM_IME_KEYLAST                 = $010F;
  200.  
  201.   WM_IME_SETCONTEXT              = $0281;
  202.   WM_IME_NOTIFY                  = $0282;
  203.   WM_IME_CONTROL                 = $0283;
  204.   WM_IME_COMPOSITIONFULL         = $0284;
  205.   WM_IME_SELECT                  = $0285;
  206.   WM_IME_CHAR                    = $0286;
  207.  
  208.   WM_IME_KEYDOWN                 = $0290;
  209.   WM_IME_KEYUP                   = $0291;
  210.  
  211. { wParam for WM_IME_CONTROL }
  212.   IMC_GETCANDIDATEPOS            = $0007;
  213.   IMC_SETCANDIDATEPOS            = $0008;
  214.   IMC_GETCOMPOSITIONFONT         = $0009;
  215.   IMC_SETCOMPOSITIONFONT         = $000A;
  216.   IMC_GETCOMPOSITIONWINDOW       = $000B;
  217.   IMC_SETCOMPOSITIONWINDOW       = $000C;
  218.   IMC_GETSTATUSWINDOWPOS         = $000F;
  219.   IMC_SETSTATUSWINDOWPOS         = $0010;
  220.   IMC_CLOSESTATUSWINDOW          = $0021;
  221.   IMC_OPENSTATUSWINDOW           = $0022;
  222.  
  223. { wParam for WM_IME_CONTROL to the soft keyboard }
  224. { dwAction for ImmNotifyIME }
  225.   NI_OPENCANDIDATE               = $0010;
  226.   NI_CLOSECANDIDATE              = $0011;
  227.   NI_SELECTCANDIDATESTR          = $0012;
  228.   NI_CHANGECANDIDATELIST         = $0013;
  229.   NI_FINALIZECONVERSIONRESULT    = $0014;
  230.   NI_COMPOSITIONSTR              = $0015;
  231.   NI_SETCANDIDATE_PAGESTART      = $0016;
  232.   NI_SETCANDIDATE_PAGESIZE       = $0017;
  233.  
  234. { lParam for WM_IME_SETCONTEXT }
  235.   ISC_SHOWUICANDIDATEWINDOW      = $00000001;
  236.   ISC_SHOWUICOMPOSITIONWINDOW    = $80000000;
  237.   ISC_SHOWUIGUIDELINE            = $40000000;
  238.   ISC_SHOWUIALLCANDIDATEWINDOW   = $0000000F;
  239.   ISC_SHOWUIALL                  = $C000000F;
  240.  
  241. { dwIndex for ImmNotifyIME/NI_COMPOSITIONSTR }
  242.   CPS_COMPLETE                   = $0001;
  243.   CPS_CONVERT                    = $0002;
  244.   CPS_REVERT                     = $0003;
  245.   CPS_CANCEL                     = $0004;
  246.  
  247. { the modifiers of hot key }
  248.   MOD_ALT                        = $0001;
  249.   MOD_CONTROL                    = $0002;
  250.   MOD_SHIFT                      = $0004;
  251.  
  252.   MOD_LEFT                       = $8000;
  253.   MOD_RIGHT                      = $4000;
  254.  
  255.   MOD_ON_KEYUP                   = $0800;
  256.   MOD_IGNORE_ALL_MODIFIER        = $0400;
  257.  
  258. { Windows for Simplified Chinese Edition hot key ID from #10 - #2F }
  259.   IME_CHOTKEY_IME_NONIME_TOGGLE          = $10;
  260.   IME_CHOTKEY_SHAPE_TOGGLE               = $11;
  261.   IME_CHOTKEY_SYMBOL_TOGGLE              = $12;
  262.  
  263. { Windows for Japanese Edition hot key ID from #30 - #4F }
  264.   IME_JHOTKEY_CLOSE_OPEN                 = $30;
  265.  
  266. { Windows for Korean Edition hot key ID from #50 - #6F }
  267.   IME_KHOTKEY_SHAPE_TOGGLE               = $50;
  268.   IME_KHOTKEY_HANJACONVERT               = $51;
  269.   IME_KHOTKEY_ENGLISH                    = $52;
  270.  
  271. { Windows for Tranditional Chinese Edition hot key ID from #70 - #8F }
  272.   IME_THOTKEY_IME_NONIME_TOGGLE          = $70;
  273.   IME_THOTKEY_SHAPE_TOGGLE               = $71;
  274.   IME_THOTKEY_SYMBOL_TOGGLE              = $72;
  275.  
  276. { direct switch hot key ID from #100 - #11F }
  277.   IME_HOTKEY_DSWITCH_FIRST               = $100;
  278.   IME_HOTKEY_DSWITCH_LAST                = $11F;
  279.  
  280. { IME private hot key from #200 - #21F }
  281.   IME_ITHOTKEY_RESEND_RESULTSTR          = $200;
  282.   IME_ITHOTKEY_PREVIOUS_COMPOSITION      = $201;
  283.   IME_ITHOTKEY_UISTYLE_TOGGLE            = $202;
  284.  
  285. { parameter of ImmGetCompositionString }
  286.   GCS_COMPREADSTR                = $0001;
  287.   GCS_COMPREADATTR               = $0002;
  288.   GCS_COMPREADCLAUSE             = $0004;
  289.   GCS_COMPSTR                    = $0008;
  290.   GCS_COMPATTR                   = $0010;
  291.   GCS_COMPCLAUSE                 = $0020;
  292.   GCS_CURSORPOS                  = $0080;
  293.   GCS_DELTASTART                 = $0100;
  294.   GCS_RESULTREADSTR              = $0200;
  295.   GCS_RESULTREADCLAUSE           = $0400;
  296.   GCS_RESULTSTR                  = $0800;
  297.   GCS_RESULTCLAUSE               = $1000;
  298.  
  299. { style bit flags for WM_IME_COMPOSITION }
  300.   CS_INSERTCHAR                  = $2000;
  301.   CS_NOMOVECARET                 = $4000;
  302.  
  303. { bits of fdwInit of INPUTCONTEXT }
  304. { IME version constants }
  305.   IMEVER_0310                    = $0003000A;
  306.   IMEVER_0400                    = $00040000;
  307.  
  308. { IME property bits }
  309.   IME_PROP_AT_CARET              = $00010000;
  310.   IME_PROP_SPECIAL_UI            = $00020000;
  311.   IME_PROP_CANDLIST_START_FROM_1 = $00040000;
  312.   IME_PROP_UNICODE               = $00080000;
  313.  
  314. { IME UICapability bits }
  315.   UI_CAP_2700                    = $00000001;
  316.   UI_CAP_ROT90                   = $00000002;
  317.   UI_CAP_ROTANY                  = $00000004;
  318.  
  319. { ImmSetCompositionString Capability bits }
  320.   SCS_CAP_COMPSTR                = $00000001;
  321.   SCS_CAP_MAKEREAD               = $00000002;
  322.  
  323. { IME WM_IME_SELECT inheritance Capability bits }
  324.   SELECT_CAP_CONVERSION          = $00000001;
  325.   SELECT_CAP_SENTENCE            = $00000002;
  326.  
  327. { ID for deIndex of ImmGetGuideLine }
  328.   GGL_LEVEL                      = $00000001;
  329.   GGL_INDEX                      = $00000002;
  330.   GGL_STRING                     = $00000003;
  331.   GGL_PRIVATE                    = $00000004;
  332.  
  333. { ID for dwLevel of GUIDELINE Structure }
  334.   GL_LEVEL_NOGUIDELINE           = $00000000;
  335.   GL_LEVEL_FATAL                 = $00000001;
  336.   GL_LEVEL_ERROR                 = $00000002;
  337.   GL_LEVEL_WARNING               = $00000003;
  338.   GL_LEVEL_INFORMATION           = $00000004;
  339.  
  340. { ID for dwIndex of GUIDELINE Structure }
  341.   GL_ID_UNKNOWN                  = $00000000;
  342.   GL_ID_NOMODULE                 = $00000001;
  343.   GL_ID_NODICTIONARY             = $00000010;
  344.   GL_ID_CANNOTSAVE               = $00000011;
  345.   GL_ID_NOCONVERT                = $00000020;
  346.   GL_ID_TYPINGERROR              = $00000021;
  347.   GL_ID_TOOMANYSTROKE            = $00000022;
  348.   GL_ID_READINGCONFLICT          = $00000023;
  349.   GL_ID_INPUTREADING             = $00000024;
  350.   GL_ID_INPUTRADICAL             = $00000025;
  351.   GL_ID_INPUTCODE                = $00000026;
  352.   GL_ID_INPUTSYMBOL              = $00000027;
  353.   GL_ID_CHOOSECANDIDATE          = $00000028;
  354.   GL_ID_REVERSECONVERSION        = $00000029;
  355.   GL_ID_PRIVATE_FIRST            = $00008000;
  356.   GL_ID_PRIVATE_LAST             = $0000FFFF;
  357.  
  358. { ID for dwIndex of ImmGetProperty }
  359.   IGP_GETIMEVERSION              = 4;
  360.   IGP_PROPERTY                   = $00000004;
  361.   IGP_CONVERSION                 = $00000008;
  362.   IGP_SENTENCE                   = $0000000c;
  363.   IGP_UI                         = $00000010;
  364.   IGP_SETCOMPSTR                 = $00000014;
  365.   IGP_SELECT                     = $00000018;
  366.  
  367. { dwIndex for ImmSetCompositionString API }
  368.   SCS_SETSTR                     = (GCS_COMPREADSTR or GCS_COMPSTR);
  369.   SCS_CHANGEATTR                 = (GCS_COMPREADATTR or GCS_COMPATTR);
  370.   SCS_CHANGECLAUSE               = (GCS_COMPREADCLAUSE or GCS_COMPCLAUSE);
  371.  
  372. { attribute for COMPOSITIONSTRING Structure }
  373.   ATTR_INPUT                     = $00;
  374.   ATTR_TARGET_CONVERTED          = $01;
  375.   ATTR_CONVERTED                 = $02;
  376.   ATTR_TARGET_NOTCONVERTED       = $03;
  377.   ATTR_INPUT_ERROR               = $04;
  378.  
  379. { bit field for IMC_SETCOMPOSITIONWINDOW, IMC_SETCANDIDATEWINDOW }
  380.   CFS_DEFAULT                    = $0000;
  381.   CFS_RECT                       = $0001;
  382.   CFS_POINT                      = $0002;
  383.   CFS_SCREEN                     = $0004;
  384.   CFS_FORCE_POSITION             = $0020;
  385.   CFS_CANDIDATEPOS               = $0040;
  386.   CFS_EXCLUDE                    = $0080;
  387.  
  388. { conversion direction for ImmGetConversionList }
  389.   GCL_CONVERSION                 = $0001;
  390.   GCL_REVERSECONVERSION          = $0002;
  391.   GCL_REVERSE_LENGTH             = $0003;
  392.  
  393. { bit field for conversion mode }
  394.   IME_CMODE_ALPHANUMERIC         = $0000;
  395.   IME_CMODE_NATIVE               = $0001;
  396.   IME_CMODE_CHINESE              = IME_CMODE_NATIVE;
  397.   IME_CMODE_HANGEUL              = IME_CMODE_NATIVE;
  398.   IME_CMODE_JAPANESE             = IME_CMODE_NATIVE;
  399.   IME_CMODE_KATAKANA             = $0002;  { only effect under IME_CMODE_NATIVE}
  400.   IME_CMODE_LANGUAGE             = $0003;
  401.   IME_CMODE_FULLSHAPE            = $0008;
  402.   IME_CMODE_ROMAN                = $0010;
  403.   IME_CMODE_CHARCODE             = $0020;
  404.   IME_CMODE_HANJACONVERT         = $0040;
  405.   IME_CMODE_SOFTKBD              = $0080;
  406.   IME_CMODE_NOCONVERSION         = $0100;
  407.   IME_CMODE_EUDC                 = $0200;
  408.   IME_CMODE_SYMBOL               = $0400;
  409.  
  410.   IME_SMODE_NONE                 = $0000;
  411.   IME_SMODE_PLAURALCLAUSE        = $0001;
  412.   IME_SMODE_SINGLECONVERT        = $0002;
  413.   IME_SMODE_AUTOMATIC            = $0004;
  414.   IME_SMODE_PHRASEPREDICT        = $0008;
  415.  
  416. { style of candidate }
  417.   IME_CAND_UNKNOWN               = $0000;
  418.   IME_CAND_READ                  = $0001;
  419.   IME_CAND_CODE                  = $0002;
  420.   IME_CAND_MEANING               = $0003;
  421.   IME_CAND_RADICAL               = $0004;
  422.   IME_CAND_STROKE                = $0005;
  423.  
  424. { wParam of report message WM_IME_NOTIFY }
  425.   IMN_CLOSESTATUSWINDOW          = $0001;
  426.   IMN_OPENSTATUSWINDOW           = $0002;
  427.   IMN_CHANGECANDIDATE            = $0003;
  428.   IMN_CLOSECANDIDATE             = $0004;
  429.   IMN_OPENCANDIDATE              = $0005;
  430.   IMN_SETCONVERSIONMODE          = $0006;
  431.   IMN_SETSENTENCEMODE            = $0007;
  432.   IMN_SETOPENSTATUS              = $0008;
  433.   IMN_SETCANDIDATEPOS            = $0009;
  434.   IMN_SETCOMPOSITIONFONT         = $000A;
  435.   IMN_SETCOMPOSITIONWINDOW       = $000B;
  436.   IMN_SETSTATUSWINDOWPOS         = $000C;
  437.   IMN_GUIDELINE                  = $000D;
  438.   IMN_PRIVATE                    = $000E;
  439.  
  440. { error code of ImmGetCompositionString }
  441.   IMM_ERROR_NODATA               = -1;
  442.   IMM_ERROR_GENERAL              = -2;
  443.  
  444. { dialog mode of ImmConfigureIME }
  445.   IME_CONFIG_GENERAL             = 1;
  446.   IME_CONFIG_REGISTERWORD        = 2;
  447.   IME_CONFIG_SELECTDICTIONARY    = 3;
  448.  
  449. { dialog mode of ImmEscape }
  450.   IME_ESC_QUERY_SUPPORT          = $0003;
  451.   IME_ESC_RESERVED_FIRST         = $0004;
  452.   IME_ESC_RESERVED_LAST          = $07FF;
  453.   IME_ESC_PRIVATE_FIRST          = $0800;
  454.   IME_ESC_PRIVATE_LAST           = $0FFF;
  455.   IME_ESC_SEQUENCE_TO_INTERNAL   = $1001;
  456.   IME_ESC_GET_EUDC_DICTIONARY    = $1003;
  457.   IME_ESC_SET_EUDC_DICTIONARY    = $1004;
  458.   IME_ESC_MAX_KEY                = $1005;
  459.   IME_ESC_IME_NAME               = $1006;
  460.   IME_ESC_SYNC_HOTKEY            = $1007;
  461.   IME_ESC_HANJA_MODE             = $1008;
  462.   IME_ESC_AUTOMATA               = $1009;
  463.  
  464. { style of word registration }
  465.   IME_REGWORD_STYLE_EUDC         = $00000001;
  466.   IME_REGWORD_STYLE_USER_FIRST   = $80000000;
  467.   IME_REGWORD_STYLE_USER_LAST    = $FFFFFFFF;
  468.  
  469. { type of soft keyboard }
  470. { for Windows Tranditional Chinese Edition }
  471.   SOFTKEYBOARD_TYPE_T1           = $0001;
  472. { for Windows Simplified Chinese Edition }
  473.   SOFTKEYBOARD_TYPE_C1           = $0002;
  474.  
  475. const
  476.   imm32 = 'imm32.dll';
  477.  
  478. implementation
  479.  
  480. function ImmInstallIMEA; external imm32 name 'ImmInstallIMEA';
  481. function ImmInstallIMEW; external imm32 name 'ImmInstallIMEW';
  482. function ImmInstallIME; external imm32 name 'ImmInstallIMEA';
  483.  
  484. function ImmGetDefaultIMEWnd; external imm32 name 'ImmGetDefaultIMEWnd{%}';
  485.  
  486. function ImmGetDescriptionA; external imm32 name 'ImmGetDescriptionA';
  487. function ImmGetDescriptionW; external imm32 name 'ImmGetDescriptionW';
  488. function ImmGetDescription; external imm32 name 'ImmGetDescriptionA';
  489.  
  490. function ImmGetIMEFileNameA; external imm32 name 'ImmGetIMEFileNameA';
  491. function ImmGetIMEFileNameW; external imm32 name 'ImmGetIMEFileNameW';
  492. function ImmGetIMEFileName; external imm32 name 'ImmGetIMEFileNameA';
  493.  
  494. function ImmGetProperty; external imm32 name 'ImmGetProperty';
  495.  
  496. function ImmIsIME; external imm32 name 'ImmIsIME';
  497.  
  498. function ImmSimulateHotKey; external imm32 name 'ImmSimulateHotKey';
  499.  
  500. function ImmCreateContext; external imm32 name 'ImmCreateContext';
  501. function ImmDestroyContext; external imm32 name 'ImmDestroyContext';
  502. function ImmGetContext; external imm32 name 'ImmGetContext';
  503. function ImmReleaseContext; external imm32 name 'ImmReleaseContext';
  504. function ImmAssociateContext; external imm32 name 'ImmAssociateContext';
  505.  
  506.  
  507. function ImmGetCompositionStringA; external imm32 name 'ImmGetCompositionStringA';
  508. function ImmGetCompositionStringW; external imm32 name 'ImmGetCompositionStringW';
  509. function ImmGetCompositionString; external imm32 name 'ImmGetCompositionStringA';
  510.  
  511. function ImmSetCompositionStringA; external imm32 name 'ImmSetCompositionStringA';
  512. function ImmSetCompositionStringW; external imm32 name 'ImmSetCompositionStringW';
  513. function ImmSetCompositionString; external imm32 name 'ImmSetCompositionStringA';
  514.  
  515. function ImmGetCandidateListCountA; external imm32 name 'ImmGetCandidateListCountA';
  516. function ImmGetCandidateListCountW; external imm32 name 'ImmGetCandidateListCountW';
  517. function ImmGetCandidateListCount; external imm32 name 'ImmGetCandidateListCountA';
  518.  
  519. function ImmGetCandidateListA; external imm32 name 'ImmGetCandidateListA';
  520. function ImmGetCandidateListW; external imm32 name 'ImmGetCandidateListW';
  521. function ImmGetCandidateList; external imm32 name 'ImmGetCandidateListA';
  522.  
  523. function ImmGetGuideLineA; external imm32 name 'ImmGetGuideLineA';
  524. function ImmGetGuideLineW; external imm32 name 'ImmGetGuideLineW';
  525. function ImmGetGuideLine; external imm32 name 'ImmGetGuideLineA';
  526.  
  527. function ImmGetConversionStatus; external imm32 name 'ImmGetConversionStatus';
  528. function ImmSetConversionStatus; external imm32 name 'ImmSetConversionStatus';
  529. function ImmGetOpenStatus; external imm32 name 'ImmGetOpenStatus';
  530. function ImmSetOpenStatus; external imm32 name 'ImmSetOpenStatus';
  531.  
  532. function ImmGetCompositionFontA; external imm32 name 'ImmGetCompositionFontA';
  533. function ImmGetCompositionFontW; external imm32 name 'ImmGetCompositionFontW';
  534. function ImmGetCompositionFont; external imm32 name 'ImmGetCompositionFontA';
  535.  
  536. function ImmSetCompositionFontA; external imm32 name 'ImmSetCompositionFontA';
  537. function ImmSetCompositionFontW; external imm32 name 'ImmSetCompositionFontW';
  538. function ImmSetCompositionFont; external imm32 name 'ImmSetCompositionFontA';
  539.  
  540. function ImmConfigureIMEA; external imm32 name 'ImmConfigureIMEA';
  541. function ImmConfigureIMEW; external imm32 name 'ImmConfigureIMEW';
  542. function ImmConfigureIME; external imm32 name 'ImmConfigureIMEA';
  543.  
  544. function ImmEscapeA; external imm32 name 'ImmEscapeA';
  545. function ImmEscapeW; external imm32 name 'ImmEscapeW';
  546. function ImmEscape; external imm32 name 'ImmEscapeA';
  547.  
  548. function ImmGetConversionListA; external imm32 name 'ImmGetConversionListA';
  549. function ImmGetConversionListW; external imm32 name 'ImmGetConversionListW';
  550. function ImmGetConversionList; external imm32 name 'ImmGetConversionListA';
  551.  
  552. function ImmNotifyIME; external imm32 name 'ImmNotifyIME';
  553.  
  554. function ImmGetStatusWindowPos; external imm32 name 'ImmGetStatusWindowPos';
  555. function ImmSetStatusWindowPos; external imm32 name 'ImmSetStatusWindowPos';
  556. function ImmGetCompositionWindow; external imm32 name 'ImmGetCompositionWindow';
  557. function ImmSetCompositionWindow; external imm32 name 'ImmSetCompositionWindow';
  558. function ImmGetCandidateWindow; external imm32 name 'ImmGetCandidateWindow';
  559. function ImmSetCandidateWindow; external imm32 name 'ImmSetCandidateWindow';
  560.  
  561.  
  562. function ImmIsUIMessageA; external imm32 name 'ImmIsUIMessageA';
  563. function ImmIsUIMessageW; external imm32 name 'ImmIsUIMessageW';
  564. function ImmIsUIMessage; external imm32 name 'ImmIsUIMessageA';
  565.  
  566. function ImmGetVirtualKey; external imm32 name 'ImmGetVirtualKey';
  567.  
  568. function ImmRegisterWordA; external imm32 name 'ImmRegisterWordA';
  569. function ImmRegisterWordW; external imm32 name 'ImmRegisterWordW';
  570. function ImmRegisterWord; external imm32 name 'ImmRegisterWordA';
  571.  
  572. function ImmUnregisterWordA; external imm32 name 'ImmUnregisterWordA';
  573. function ImmUnregisterWordW; external imm32 name 'ImmUnregisterWordW';
  574. function ImmUnregisterWord; external imm32 name 'ImmUnregisterWordA';
  575.  
  576. function ImmGetRegisterWordStyleA; external imm32 name 'ImmGetRegisterWordStyleA';
  577. function ImmGetRegisterWordStyleW; external imm32 name 'ImmGetRegisterWordStyleW';
  578. function ImmGetRegisterWordStyle; external imm32 name 'ImmGetRegisterWordStyleA';
  579.  
  580. function ImmEnumRegisterWordA; external imm32 name 'ImmEnumRegisterWordA';
  581. function ImmEnumRegisterWordW; external imm32 name 'ImmEnumRegisterWordW';
  582. function ImmEnumRegisterWord; external imm32 name 'ImmEnumRegisterWordA';
  583.  
  584. end.
  585.