home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
IMM.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-02-28
|
27KB
|
596 lines
{*******************************************************}
{ }
{ Delphi Run-time Library }
{ Windows 32bit API Interface Unit }
{ }
{ Copyright (c) 1996 Borland International }
{ }
{*******************************************************}
unit Imm;
{$A+,Z+}
interface
uses Windows;
const
VK_PROCESSKEY = $E5;
type
HIMC = Integer;
{$nonamespace HIMC}
PCompositionForm = ^TCompositionForm;
tagCOMPOSITIONFORM = record
dwStyle: DWORD;
ptCurrentPos: TPOINT;
rcArea: TRECT;
end;
{$nonamespace tagCOMPOSITIONFORM}
TCompositionForm = tagCOMPOSITIONFORM;
PCandidateForm = ^TCandidateForm;
tagCANDIDATEFORM = record
dwIndex: DWORD;
dwStyle: DWORD;
ptCurrentPos: TPOINT;
rcArea: TRECT;
end;
{$nonamespace tagCANDIDATEFORM}
TCandidateForm = tagCANDIDATEFORM;
PCandidateList = ^TCandidateList;
tagCANDIDATELIST = record
dwSize: DWORD;
dwStyle: DWORD;
dwCount: DWORD;
dwSelection: DWORD;
dwPageStart: DWORD;
dwPageSize: DWORD;
dwOffset: array[1..1] of DWORD;
end;
{$nonamespace tagCANDIDATELIST}
TCandidateList = tagCANDIDATELIST;
PRegisterWordA = ^TRegisterWordA;
PRegisterWordW = ^TRegisterWordW;
PRegisterWord = PRegisterWordA;
tagREGISTERWORDA = record
lpReading: PAnsiChar;
lpWord: PAnsiChar;
end;
{$nonamespace tagREGISTERWORDA}
TRegisterWordA = tagREGISTERWORDA;
tagREGISTERWORDW = record
lpReading: PWideChar;
lpWord: PWideChar;
end;
{$nonamespace tagREGISTERWORDW}
TRegisterWordW = tagREGISTERWORDW;
TRegisterWord = TRegisterWordA;
const
STYLE_DESCRIPTION_SIZE = 32;
type
PStyleBufA = ^TStyleBufA;
PStyleBufW = ^TStyleBufW;
PStyleBuf = PStyleBufA;
tagSTYLEBUFA = record
dwStyle: DWORD;
szDescription: array[0..STYLE_DESCRIPTION_SIZE-1] of AnsiChar;
end;
{$nonamespace tagSTYLEBUFA}
TStyleBufA = tagSTYLEBUFA;
tagSTYLEBUFW = record
dwStyle: DWORD;
szDescription: array[0..STYLE_DESCRIPTION_SIZE-1] of WideChar;
end;
{$nonamespace tagSTYLEBUFW}
TStyleBufW = tagSTYLEBUFW;
TStyleBuf = TStyleBufA;
{ prototype of IMM API }
function ImmInstallIMEA(lpszIMEFileName, lpszLayoutText: PAnsiChar): HKL; stdcall;
function ImmInstallIMEW(lpszIMEFileName, lpszLayoutText: PWideChar): HKL; stdcall;
function ImmInstallIME(lpszIMEFileName, lpszLayoutText: PChar): HKL; stdcall;
function ImmGetDefaultIMEWnd(hWnd: HWND): HWND; stdcall;
function ImmGetDescriptionA(hKl: HKL; PAnsiChar: PAnsiChar; uBufLen: UINT): UINT; stdcall;
function ImmGetDescriptionW(hKl: HKL; PWideChar: PWideChar; uBufLen: UINT): UINT; stdcall;
function ImmGetDescription(hKl: HKL; PChar: PChar; uBufLen: UINT): UINT; stdcall;
function ImmGetIMEFileNameA(hKl: HKL; PAnsiChar: PAnsiChar; uBufLen: UINT): UINT; stdcall;
function ImmGetIMEFileNameW(hKl: HKL; PWideChar: PWideChar; uBufLen: UINT): UINT; stdcall;
function ImmGetIMEFileName(hKl: HKL; PChar: PChar; uBufLen: UINT): UINT; stdcall;
function ImmGetProperty(hKl: HKL; dWord: DWORD): DWORD; stdcall;
function ImmIsIME(hKl: HKL): Boolean; stdcall;
function ImmSimulateHotKey(hWnd: HWND; dWord: DWORD): Boolean; stdcall;
function ImmCreateContext: HIMC; stdcall;
function ImmDestroyContext(hImc: HIMC): Boolean; stdcall;
function ImmGetContext(hWnd: HWND): HIMC; stdcall;
function ImmReleaseContext(hWnd: HWND; hImc: HIMC): Boolean; stdcall;
function ImmAssociateContext(hWnd: HWND; hImc: HIMC): HIMC; stdcall;
function ImmGetCompositionStringA(hImc: HIMC; dWord1: DWORD; lpBuf: pointer; dwBufLen: DWORD): Longint; stdcall;
function ImmGetCompositionStringW(hImc: HIMC; dWord1: DWORD; lpBuf: pointer; dwBufLen: DWORD): Longint; stdcall;
function ImmGetCompositionString(hImc: HIMC; dWord1: DWORD; lpBuf: pointer; dwBufLen: DWORD): Longint; stdcall;
function ImmSetCompositionStringA(hImc: HIMC; dwIndex: DWORD; lpComp: pointer; dwCompLen: DWORD; lpRead: pointer; dwReadLen: DWORD):Boolean; stdcall;
function ImmSetCompositionStringW(hImc: HIMC; dwIndex: DWORD; lpComp: pointer; dwCompLen: DWORD; lpRead: pointer; dwReadLen: DWORD):Boolean; stdcall;
function ImmSetCompositionString(hImc: HIMC; dwIndex: DWORD; lpComp: pointer; dwCompLen: DWORD; lpRead: pointer; dwReadLen: DWORD):Boolean; stdcall;
function ImmGetCandidateListCountA(hImc: HIMC; var ListCount: DWORD): DWORD; stdcall;
function ImmGetCandidateListCountW(hImc: HIMC; var ListCount: DWORD): DWORD; stdcall;
function ImmGetCandidateListCount(hImc: HIMC; var ListCount: DWORD): DWORD; stdcall;
function ImmGetCandidateListA(hImc: HIMC; deIndex: DWORD; lpCandidateList: PCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall;
function ImmGetCandidateListW(hImc: HIMC; deIndex: DWORD; lpCandidateList: PCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall;
function ImmGetCandidateList(hImc: HIMC; deIndex: DWORD; lpCandidateList: PCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall;
function ImmGetGuideLineA(hImc: HIMC; dwIndex: DWORD; lpBuf: PAnsiChar; dwBufLen: DWORD): DWORD; stdcall;
function ImmGetGuideLineW(hImc: HIMC; dwIndex: DWORD; lpBuf: PWideChar; dwBufLen: DWORD): DWORD; stdcall;
function ImmGetGuideLine(hImc: HIMC; dwIndex: DWORD; lpBuf: PChar; dwBufLen: DWORD): DWORD; stdcall;
function ImmGetConversionStatus(hImc: HIMC; var Conversion, Sentence: DWORD): Boolean; stdcall;
function ImmSetConversionStatus(hImc: HIMC; Conversion, Sentence: DWORD): Boolean; stdcall;
function ImmGetOpenStatus(hImc: HIMC): Boolean; stdcall;
function ImmSetOpenStatus(hImc: HIMC; fOpen: Boolean): Boolean; stdcall;
function ImmGetCompositionFontA(hImc: HIMC; lpLogfont: PLOGFONTA): Boolean; stdcall;
function ImmGetCompositionFontW(hImc: HIMC; lpLogfont: PLOGFONTW): Boolean; stdcall;
function ImmGetCompositionFont(hImc: HIMC; lpLogfont: PLOGFONT): Boolean; stdcall;
function ImmSetCompositionFontA(hImc: HIMC; lpLogfont: PLOGFONTA): Boolean; stdcall;
function ImmSetCompositionFontW(hImc: HIMC; lpLogfont: PLOGFONTW): Boolean; stdcall;
function ImmSetCompositionFont(hImc: HIMC; lpLogfont: PLOGFONT): Boolean; stdcall;
function ImmConfigureIMEA(hKl: HKL; hWnd: HWND; dwMode: DWORD; lpData: pointer): Boolean; stdcall;
function ImmConfigureIMEW(hKl: HKL; hWnd: HWND; dwMode: DWORD; lpData: pointer): Boolean; stdcall;
function ImmConfigureIME(hKl: HKL; hWnd: HWND; dwMode: DWORD; lpData: pointer): Boolean; stdcall;
function ImmEscapeA(hKl: HKL; hImc: HIMC; uEscape: UINT; lpData: pointer): LRESULT; stdcall;
function ImmEscapeW(hKl: HKL; hImc: HIMC; uEscape: UINT; lpData: pointer): LRESULT; stdcall;
function ImmEscape(hKl: HKL; hImc: HIMC; uEscape: UINT; lpData: pointer): LRESULT; stdcall;
function ImmGetConversionListA(hKl: HKL; hImc: HIMC; lpSrc: PAnsiChar; lpDst: PCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT ): DWORD; stdcall;
function ImmGetConversionListW(hKl: HKL; hImc: HIMC; lpSrc: PWideChar; lpDst: PCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT ): DWORD; stdcall;
function ImmGetConversionList(hKl: HKL; hImc: HIMC; lpSrc: PChar; lpDst: PCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT ): DWORD; stdcall;
function ImmNotifyIME(hImc: HIMC; dwAction, dwIndex, dwValue: DWORD): Boolean; stdcall;
function ImmGetStatusWindowPos(hImc: HIMC; var lpPoint : TPoint): Boolean; stdcall;
function ImmSetStatusWindowPos(hImc: HIMC; lpPoint: PPOINT): Boolean; stdcall;
function ImmGetCompositionWindow(hImc: HIMC; lpCompForm: PCOMPOSITIONFORM): Boolean; stdcall;
function ImmSetCompositionWindow(hImc: HIMC; lpCompForm: PCOMPOSITIONFORM): Boolean; stdcall;
function ImmGetCandidateWindow(hImc: HIMC; dwBufLen: DWORD; lpCandidate: PCANDIDATEFORM): Boolean; stdcall;
function ImmSetCandidateWindow(hImc: HIMC; lpCandidate: PCANDIDATEFORM): Boolean; stdcall;
function ImmIsUIMessageA(hWnd: HWND; msg: UINT; wParam: WPARAM; lParam: LPARAM): Boolean; stdcall;
function ImmIsUIMessageW(hWnd: HWND; msg: UINT; wParam: WPARAM; lParam: LPARAM): Boolean; stdcall;
function ImmIsUIMessage(hWnd: HWND; msg: UINT; wParam: WPARAM; lParam: LPARAM): Boolean; stdcall;
function ImmGetVirtualKey(hWnd: HWND): UINT; stdcall;
type
RegisterWordEnumProcA = Function(lpReading: PAnsiChar; dwStyle: DWORD; lpszString: PAnsiChar; lpData: pointer): integer;
RegisterWordEnumProcW = Function(lpReading: PWideChar; dwStyle: DWORD; lpszString: PWideChar; lpData: pointer): integer;
RegisterWordEnumProc = RegisterWordEnumProcA;
function ImmRegisterWordA(hKl: HKL; lpszReading: PAnsiChar; dwStyle: DWORD; lpszRegister: PAnsiChar): Boolean; stdcall;
function ImmRegisterWordW(hKl: HKL; lpszReading: PWideChar; dwStyle: DWORD; lpszRegister: PWideChar): Boolean; stdcall;
function ImmRegisterWord(hKl: HKL; lpszReading: PChar; dwStyle: DWORD; lpszRegister: PChar): Boolean; stdcall;
function ImmUnregisterWordA(hKl: HKL; lpszReading: PAnsiChar; dwStyle: DWORD; lpszUnregister: PAnsiChar): Boolean; stdcall;
function ImmUnregisterWordW(hKl: HKL; lpszReading: PWideChar; dwStyle: DWORD; lpszUnregister: PWideChar): Boolean; stdcall;
function ImmUnregisterWord(hKl: HKL; lpszReading: PChar; dwStyle: DWORD; lpszUnregister: PChar): Boolean; stdcall;
function ImmGetRegisterWordStyleA(hKl: HKL; nItem: UINT; lpStyleBuf: PSTYLEBUFA): UINT; stdcall;
function ImmGetRegisterWordStyleW(hKl: HKL; nItem: UINT; lpStyleBuf: PSTYLEBUFW): UINT; stdcall;
function ImmGetRegisterWordStyle(hKl: HKL; nItem: UINT; lpStyleBuf: PSTYLEBUF): UINT; stdcall;
function ImmEnumRegisterWordA(hKl: HKL; lpfnEnumProc: REGISTERWORDENUMPROCA; lpszReading: PAnsiChar; dwStyle: DWORD; lpszRegister: PAnsiChar; lpData : pointer): UINT; stdcall;
function ImmEnumRegisterWordW(hKl: HKL; lpfnEnumProc: REGISTERWORDENUMPROCW; lpszReading: PWideChar; dwStyle: DWORD; lpszRegister: PWideChar; lpData : pointer): UINT; stdcall;
function ImmEnumRegisterWord(hKl: HKL; lpfnEnumProc: REGISTERWORDENUMPROC; lpszReading: PChar; dwStyle: DWORD; lpszRegister: PChar; lpData : pointer): UINT; stdcall;
const
{ the IME related messages }
WM_CONVERTREQUESTEX = $0108;
WM_IME_STARTCOMPOSITION = $010D;
WM_IME_ENDCOMPOSITION = $010E;
WM_IME_COMPOSITION = $010F;
WM_IME_KEYLAST = $010F;
WM_IME_SETCONTEXT = $0281;
WM_IME_NOTIFY = $0282;
WM_IME_CONTROL = $0283;
WM_IME_COMPOSITIONFULL = $0284;
WM_IME_SELECT = $0285;
WM_IME_CHAR = $0286;
WM_IME_KEYDOWN = $0290;
WM_IME_KEYUP = $0291;
{ wParam for WM_IME_CONTROL }
IMC_GETCANDIDATEPOS = $0007;
IMC_SETCANDIDATEPOS = $0008;
IMC_GETCOMPOSITIONFONT = $0009;
IMC_SETCOMPOSITIONFONT = $000A;
IMC_GETCOMPOSITIONWINDOW = $000B;
IMC_SETCOMPOSITIONWINDOW = $000C;
IMC_GETSTATUSWINDOWPOS = $000F;
IMC_SETSTATUSWINDOWPOS = $0010;
IMC_CLOSESTATUSWINDOW = $0021;
IMC_OPENSTATUSWINDOW = $0022;
{ wParam for WM_IME_CONTROL to the soft keyboard }
{ dwAction for ImmNotifyIME }
NI_OPENCANDIDATE = $0010;
NI_CLOSECANDIDATE = $0011;
NI_SELECTCANDIDATESTR = $0012;
NI_CHANGECANDIDATELIST = $0013;
NI_FINALIZECONVERSIONRESULT = $0014;
NI_COMPOSITIONSTR = $0015;
NI_SETCANDIDATE_PAGESTART = $0016;
NI_SETCANDIDATE_PAGESIZE = $0017;
{ lParam for WM_IME_SETCONTEXT }
ISC_SHOWUICANDIDATEWINDOW = $00000001;
ISC_SHOWUICOMPOSITIONWINDOW = $80000000;
ISC_SHOWUIGUIDELINE = $40000000;
ISC_SHOWUIALLCANDIDATEWINDOW = $0000000F;
ISC_SHOWUIALL = $C000000F;
{ dwIndex for ImmNotifyIME/NI_COMPOSITIONSTR }
CPS_COMPLETE = $0001;
CPS_CONVERT = $0002;
CPS_REVERT = $0003;
CPS_CANCEL = $0004;
{ the modifiers of hot key }
MOD_ALT = $0001;
MOD_CONTROL = $0002;
MOD_SHIFT = $0004;
MOD_LEFT = $8000;
MOD_RIGHT = $4000;
MOD_ON_KEYUP = $0800;
MOD_IGNORE_ALL_MODIFIER = $0400;
{ Windows for Simplified Chinese Edition hot key ID from #10 - #2F }
IME_CHOTKEY_IME_NONIME_TOGGLE = $10;
IME_CHOTKEY_SHAPE_TOGGLE = $11;
IME_CHOTKEY_SYMBOL_TOGGLE = $12;
{ Windows for Japanese Edition hot key ID from #30 - #4F }
IME_JHOTKEY_CLOSE_OPEN = $30;
{ Windows for Korean Edition hot key ID from #50 - #6F }
IME_KHOTKEY_SHAPE_TOGGLE = $50;
IME_KHOTKEY_HANJACONVERT = $51;
IME_KHOTKEY_ENGLISH = $52;
{ Windows for Tranditional Chinese Edition hot key ID from #70 - #8F }
IME_THOTKEY_IME_NONIME_TOGGLE = $70;
IME_THOTKEY_SHAPE_TOGGLE = $71;
IME_THOTKEY_SYMBOL_TOGGLE = $72;
{ direct switch hot key ID from #100 - #11F }
IME_HOTKEY_DSWITCH_FIRST = $100;
IME_HOTKEY_DSWITCH_LAST = $11F;
{ IME private hot key from #200 - #21F }
IME_ITHOTKEY_RESEND_RESULTSTR = $200;
IME_ITHOTKEY_PREVIOUS_COMPOSITION = $201;
IME_ITHOTKEY_UISTYLE_TOGGLE = $202;
{ parameter of ImmGetCompositionString }
GCS_COMPREADSTR = $0001;
GCS_COMPREADATTR = $0002;
GCS_COMPREADCLAUSE = $0004;
GCS_COMPSTR = $0008;
GCS_COMPATTR = $0010;
GCS_COMPCLAUSE = $0020;
GCS_CURSORPOS = $0080;
GCS_DELTASTART = $0100;
GCS_RESULTREADSTR = $0200;
GCS_RESULTREADCLAUSE = $0400;
GCS_RESULTSTR = $0800;
GCS_RESULTCLAUSE = $1000;
{ style bit flags for WM_IME_COMPOSITION }
CS_INSERTCHAR = $2000;
CS_NOMOVECARET = $4000;
{ bits of fdwInit of INPUTCONTEXT }
{ IME version constants }
IMEVER_0310 = $0003000A;
IMEVER_0400 = $00040000;
{ IME property bits }
IME_PROP_AT_CARET = $00010000;
IME_PROP_SPECIAL_UI = $00020000;
IME_PROP_CANDLIST_START_FROM_1 = $00040000;
IME_PROP_UNICODE = $00080000;
{ IME UICapability bits }
UI_CAP_2700 = $00000001;
UI_CAP_ROT90 = $00000002;
UI_CAP_ROTANY = $00000004;
{ ImmSetCompositionString Capability bits }
SCS_CAP_COMPSTR = $00000001;
SCS_CAP_MAKEREAD = $00000002;
{ IME WM_IME_SELECT inheritance Capability bits }
SELECT_CAP_CONVERSION = $00000001;
SELECT_CAP_SENTENCE = $00000002;
{ ID for deIndex of ImmGetGuideLine }
GGL_LEVEL = $00000001;
GGL_INDEX = $00000002;
GGL_STRING = $00000003;
GGL_PRIVATE = $00000004;
{ ID for dwLevel of GUIDELINE Structure }
GL_LEVEL_NOGUIDELINE = $00000000;
GL_LEVEL_FATAL = $00000001;
GL_LEVEL_ERROR = $00000002;
GL_LEVEL_WARNING = $00000003;
GL_LEVEL_INFORMATION = $00000004;
{ ID for dwIndex of GUIDELINE Structure }
GL_ID_UNKNOWN = $00000000;
GL_ID_NOMODULE = $00000001;
GL_ID_NODICTIONARY = $00000010;
GL_ID_CANNOTSAVE = $00000011;
GL_ID_NOCONVERT = $00000020;
GL_ID_TYPINGERROR = $00000021;
GL_ID_TOOMANYSTROKE = $00000022;
GL_ID_READINGCONFLICT = $00000023;
GL_ID_INPUTREADING = $00000024;
GL_ID_INPUTRADICAL = $00000025;
GL_ID_INPUTCODE = $00000026;
GL_ID_INPUTSYMBOL = $00000027;
GL_ID_CHOOSECANDIDATE = $00000028;
GL_ID_REVERSECONVERSION = $00000029;
GL_ID_PRIVATE_FIRST = $00008000;
GL_ID_PRIVATE_LAST = $0000FFFF;
{ ID for dwIndex of ImmGetProperty }
IGP_GETIMEVERSION = 4;
IGP_PROPERTY = $00000004;
IGP_CONVERSION = $00000008;
IGP_SENTENCE = $0000000c;
IGP_UI = $00000010;
IGP_SETCOMPSTR = $00000014;
IGP_SELECT = $00000018;
{ dwIndex for ImmSetCompositionString API }
SCS_SETSTR = (GCS_COMPREADSTR or GCS_COMPSTR);
SCS_CHANGEATTR = (GCS_COMPREADATTR or GCS_COMPATTR);
SCS_CHANGECLAUSE = (GCS_COMPREADCLAUSE or GCS_COMPCLAUSE);
{ attribute for COMPOSITIONSTRING Structure }
ATTR_INPUT = $00;
ATTR_TARGET_CONVERTED = $01;
ATTR_CONVERTED = $02;
ATTR_TARGET_NOTCONVERTED = $03;
ATTR_INPUT_ERROR = $04;
{ bit field for IMC_SETCOMPOSITIONWINDOW, IMC_SETCANDIDATEWINDOW }
CFS_DEFAULT = $0000;
CFS_RECT = $0001;
CFS_POINT = $0002;
CFS_SCREEN = $0004;
CFS_FORCE_POSITION = $0020;
CFS_CANDIDATEPOS = $0040;
CFS_EXCLUDE = $0080;
{ conversion direction for ImmGetConversionList }
GCL_CONVERSION = $0001;
GCL_REVERSECONVERSION = $0002;
GCL_REVERSE_LENGTH = $0003;
{ bit field for conversion mode }
IME_CMODE_ALPHANUMERIC = $0000;
IME_CMODE_NATIVE = $0001;
IME_CMODE_CHINESE = IME_CMODE_NATIVE;
IME_CMODE_HANGEUL = IME_CMODE_NATIVE;
IME_CMODE_JAPANESE = IME_CMODE_NATIVE;
IME_CMODE_KATAKANA = $0002; { effective only under IME_CMODE_NATIVE}
IME_CMODE_LANGUAGE = $0003;
IME_CMODE_FULLSHAPE = $0008;
IME_CMODE_ROMAN = $0010;
IME_CMODE_CHARCODE = $0020;
IME_CMODE_HANJACONVERT = $0040;
IME_CMODE_SOFTKBD = $0080;
IME_CMODE_NOCONVERSION = $0100;
IME_CMODE_EUDC = $0200;
IME_CMODE_SYMBOL = $0400;
IME_SMODE_NONE = $0000;
IME_SMODE_PLAURALCLAUSE = $0001;
IME_SMODE_SINGLECONVERT = $0002;
IME_SMODE_AUTOMATIC = $0004;
IME_SMODE_PHRASEPREDICT = $0008;
{ style of candidate }
IME_CAND_UNKNOWN = $0000;
IME_CAND_READ = $0001;
IME_CAND_CODE = $0002;
IME_CAND_MEANING = $0003;
IME_CAND_RADICAL = $0004;
IME_CAND_STROKE = $0005;
{ wParam of report message WM_IME_NOTIFY }
IMN_CLOSESTATUSWINDOW = $0001;
IMN_OPENSTATUSWINDOW = $0002;
IMN_CHANGECANDIDATE = $0003;
IMN_CLOSECANDIDATE = $0004;
IMN_OPENCANDIDATE = $0005;
IMN_SETCONVERSIONMODE = $0006;
IMN_SETSENTENCEMODE = $0007;
IMN_SETOPENSTATUS = $0008;
IMN_SETCANDIDATEPOS = $0009;
IMN_SETCOMPOSITIONFONT = $000A;
IMN_SETCOMPOSITIONWINDOW = $000B;
IMN_SETSTATUSWINDOWPOS = $000C;
IMN_GUIDELINE = $000D;
IMN_PRIVATE = $000E;
{ error code of ImmGetCompositionString }
IMM_ERROR_NODATA = -1;
IMM_ERROR_GENERAL = -2;
{ dialog mode of ImmConfigureIME }
IME_CONFIG_GENERAL = 1;
IME_CONFIG_REGISTERWORD = 2;
IME_CONFIG_SELECTDICTIONARY = 3;
{ dialog mode of ImmEscape }
IME_ESC_QUERY_SUPPORT = $0003;
IME_ESC_RESERVED_FIRST = $0004;
IME_ESC_RESERVED_LAST = $07FF;
IME_ESC_PRIVATE_FIRST = $0800;
IME_ESC_PRIVATE_LAST = $0FFF;
IME_ESC_SEQUENCE_TO_INTERNAL = $1001;
IME_ESC_GET_EUDC_DICTIONARY = $1003;
IME_ESC_SET_EUDC_DICTIONARY = $1004;
IME_ESC_MAX_KEY = $1005;
IME_ESC_IME_NAME = $1006;
IME_ESC_SYNC_HOTKEY = $1007;
IME_ESC_HANJA_MODE = $1008;
IME_ESC_AUTOMATA = $1009;
{ style of word registration }
IME_REGWORD_STYLE_EUDC = $00000001;
IME_REGWORD_STYLE_USER_FIRST = $80000000;
IME_REGWORD_STYLE_USER_LAST = $FFFFFFFF;
{ type of soft keyboard }
{ for Windows Tranditional Chinese Edition }
SOFTKEYBOARD_TYPE_T1 = $0001;
{ for Windows Simplified Chinese Edition }
SOFTKEYBOARD_TYPE_C1 = $0002;
const
imm32 = 'imm32.dll';
implementation
function ImmInstallIMEA; external imm32 name 'ImmInstallIMEA';
function ImmInstallIMEW; external imm32 name 'ImmInstallIMEW';
function ImmInstallIME; external imm32 name 'ImmInstallIMEA';
function ImmGetDefaultIMEWnd; external imm32 name 'ImmGetDefaultIMEWnd{%}';
function ImmGetDescriptionA; external imm32 name 'ImmGetDescriptionA';
function ImmGetDescriptionW; external imm32 name 'ImmGetDescriptionW';
function ImmGetDescription; external imm32 name 'ImmGetDescriptionA';
function ImmGetIMEFileNameA; external imm32 name 'ImmGetIMEFileNameA';
function ImmGetIMEFileNameW; external imm32 name 'ImmGetIMEFileNameW';
function ImmGetIMEFileName; external imm32 name 'ImmGetIMEFileNameA';
function ImmGetProperty; external imm32 name 'ImmGetProperty';
function ImmIsIME; external imm32 name 'ImmIsIME';
function ImmSimulateHotKey; external imm32 name 'ImmSimulateHotKey';
function ImmCreateContext; external imm32 name 'ImmCreateContext';
function ImmDestroyContext; external imm32 name 'ImmDestroyContext';
function ImmGetContext; external imm32 name 'ImmGetContext';
function ImmReleaseContext; external imm32 name 'ImmReleaseContext';
function ImmAssociateContext; external imm32 name 'ImmAssociateContext';
function ImmGetCompositionStringA; external imm32 name 'ImmGetCompositionStringA';
function ImmGetCompositionStringW; external imm32 name 'ImmGetCompositionStringW';
function ImmGetCompositionString; external imm32 name 'ImmGetCompositionStringA';
function ImmSetCompositionStringA; external imm32 name 'ImmSetCompositionStringA';
function ImmSetCompositionStringW; external imm32 name 'ImmSetCompositionStringW';
function ImmSetCompositionString; external imm32 name 'ImmSetCompositionStringA';
function ImmGetCandidateListCountA; external imm32 name 'ImmGetCandidateListCountA';
function ImmGetCandidateListCountW; external imm32 name 'ImmGetCandidateListCountW';
function ImmGetCandidateListCount; external imm32 name 'ImmGetCandidateListCountA';
function ImmGetCandidateListA; external imm32 name 'ImmGetCandidateListA';
function ImmGetCandidateListW; external imm32 name 'ImmGetCandidateListW';
function ImmGetCandidateList; external imm32 name 'ImmGetCandidateListA';
function ImmGetGuideLineA; external imm32 name 'ImmGetGuideLineA';
function ImmGetGuideLineW; external imm32 name 'ImmGetGuideLineW';
function ImmGetGuideLine; external imm32 name 'ImmGetGuideLineA';
function ImmGetConversionStatus; external imm32 name 'ImmGetConversionStatus';
function ImmSetConversionStatus; external imm32 name 'ImmSetConversionStatus';
function ImmGetOpenStatus; external imm32 name 'ImmGetOpenStatus';
function ImmSetOpenStatus; external imm32 name 'ImmSetOpenStatus';
function ImmGetCompositionFontA; external imm32 name 'ImmGetCompositionFontA';
function ImmGetCompositionFontW; external imm32 name 'ImmGetCompositionFontW';
function ImmGetCompositionFont; external imm32 name 'ImmGetCompositionFontA';
function ImmSetCompositionFontA; external imm32 name 'ImmSetCompositionFontA';
function ImmSetCompositionFontW; external imm32 name 'ImmSetCompositionFontW';
function ImmSetCompositionFont; external imm32 name 'ImmSetCompositionFontA';
function ImmConfigureIMEA; external imm32 name 'ImmConfigureIMEA';
function ImmConfigureIMEW; external imm32 name 'ImmConfigureIMEW';
function ImmConfigureIME; external imm32 name 'ImmConfigureIMEA';
function ImmEscapeA; external imm32 name 'ImmEscapeA';
function ImmEscapeW; external imm32 name 'ImmEscapeW';
function ImmEscape; external imm32 name 'ImmEscapeA';
function ImmGetConversionListA; external imm32 name 'ImmGetConversionListA';
function ImmGetConversionListW; external imm32 name 'ImmGetConversionListW';
function ImmGetConversionList; external imm32 name 'ImmGetConversionListA';
function ImmNotifyIME; external imm32 name 'ImmNotifyIME';
function ImmGetStatusWindowPos; external imm32 name 'ImmGetStatusWindowPos';
function ImmSetStatusWindowPos; external imm32 name 'ImmSetStatusWindowPos';
function ImmGetCompositionWindow; external imm32 name 'ImmGetCompositionWindow';
function ImmSetCompositionWindow; external imm32 name 'ImmSetCompositionWindow';
function ImmGetCandidateWindow; external imm32 name 'ImmGetCandidateWindow';
function ImmSetCandidateWindow; external imm32 name 'ImmSetCandidateWindow';
function ImmIsUIMessageA; external imm32 name 'ImmIsUIMessageA';
function ImmIsUIMessageW; external imm32 name 'ImmIsUIMessageW';
function ImmIsUIMessage; external imm32 name 'ImmIsUIMessageA';
function ImmGetVirtualKey; external imm32 name 'ImmGetVirtualKey';
function ImmRegisterWordA; external imm32 name 'ImmRegisterWordA';
function ImmRegisterWordW; external imm32 name 'ImmRegisterWordW';
function ImmRegisterWord; external imm32 name 'ImmRegisterWordA';
function ImmUnregisterWordA; external imm32 name 'ImmUnregisterWordA';
function ImmUnregisterWordW; external imm32 name 'ImmUnregisterWordW';
function ImmUnregisterWord; external imm32 name 'ImmUnregisterWordA';
function ImmGetRegisterWordStyleA; external imm32 name 'ImmGetRegisterWordStyleA';
function ImmGetRegisterWordStyleW; external imm32 name 'ImmGetRegisterWordStyleW';
function ImmGetRegisterWordStyle; external imm32 name 'ImmGetRegisterWordStyleA';
function ImmEnumRegisterWordA; external imm32 name 'ImmEnumRegisterWordA';
function ImmEnumRegisterWordW; external imm32 name 'ImmEnumRegisterWordW';
function ImmEnumRegisterWord; external imm32 name 'ImmEnumRegisterWordA';
end.