📄 activeimm_tlb.pas
字号:
function Activate(fRestoreLayout: Integer): HResult; stdcall;
function Deactivate: HResult; stdcall;
function OnDefWindowProc(var hWnd: _RemotableHandle; msg: SYSUINT; wParam: UINT_PTR;
lParam: LONG_PTR; out plResult: LONG_PTR): HResult; stdcall;
function FilterClientWindows(var aaClassList: Word; uSize: SYSUINT): HResult; stdcall;
function GetCodePageA(var hKL: Pointer; out uCodePage: SYSUINT): HResult; stdcall;
function GetLangId(var hKL: Pointer; out plid: Word): HResult; stdcall;
function AssociateContextEx(var hWnd: _RemotableHandle; hIMC: LongWord; dwFlags: LongWord): HResult; stdcall;
function DisableIME(idThread: LongWord): HResult; stdcall;
function GetImeMenuItemsA(hIMC: LongWord; dwFlags: LongWord; dwType: LongWord;
var pImeParentMenu: IMEMENUITEMINFOA;
out pImeMenu: IMEMENUITEMINFOA; dwSize: LongWord;
out pdwResult: LongWord): HResult; stdcall;
function GetImeMenuItemsW(hIMC: LongWord; dwFlags: LongWord; dwType: LongWord;
var pImeParentMenu: IMEMENUITEMINFOW;
out pImeMenu: IMEMENUITEMINFOW; dwSize: LongWord;
out pdwResult: LongWord): HResult; stdcall;
function EnumInputContext(idThread: LongWord; out ppEnum: IEnumInputContext): HResult; stdcall;
end;
// *********************************************************************//
// Interface: IActiveIMMIME
// Flags: (0)
// GUID: {08C03411-F96B-11D0-A475-00AA006BCC59}
// *********************************************************************//
IActiveIMMIME = interface(IUnknown)
['{08C03411-F96B-11D0-A475-00AA006BCC59}']
function AssociateContext(var hWnd: _RemotableHandle; hIME: LongWord; out phPrev: LongWord): HResult; stdcall;
function ConfigureIMEA(var hKL: Pointer; var hWnd: _RemotableHandle; dwMode: LongWord;
var pData: REGISTERWORDA): HResult; stdcall;
function ConfigureIMEW(var hKL: Pointer; var hWnd: _RemotableHandle; dwMode: LongWord;
var pData: REGISTERWORDW): HResult; stdcall;
function CreateContext(out phIMC: LongWord): HResult; stdcall;
function DestroyContext(hIME: LongWord): HResult; stdcall;
function EnumRegisterWordA(var hKL: Pointer; szReading: PAnsiChar; dwStyle: LongWord;
szRegister: PAnsiChar; var pData: Pointer; out pEnum: IEnumRegisterWordA): HResult; stdcall;
function EnumRegisterWordW(var hKL: Pointer; szReading: PWideChar; dwStyle: LongWord;
szRegister: PWideChar; var pData: Pointer;
out pEnum: IEnumRegisterWordW): HResult; stdcall;
function EscapeA(var hKL: Pointer; hIMC: LongWord; uEscape: SYSUINT; var pData: Pointer;
out plResult: LONG_PTR): HResult; stdcall;
function EscapeW(var hKL: Pointer; hIMC: LongWord; uEscape: SYSUINT; var pData: Pointer;
out plResult: LONG_PTR): HResult; stdcall;
function GetCandidateListA(hIMC: LongWord; dwIndex: LongWord; uBufLen: SYSUINT;
out pCandList: CANDIDATELIST; out puCopied: SYSUINT): HResult; stdcall;
function GetCandidateListW(hIMC: LongWord; dwIndex: LongWord; uBufLen: SYSUINT;
out pCandList: CANDIDATELIST; out puCopied: SYSUINT): HResult; stdcall;
function GetCandidateListCountA(hIMC: LongWord; out pdwListSize: LongWord;
out pdwBufLen: LongWord): HResult; stdcall;
function GetCandidateListCountW(hIMC: LongWord; out pdwListSize: LongWord;
out pdwBufLen: LongWord): HResult; stdcall;
function GetCandidateWindow(hIMC: LongWord; dwIndex: LongWord; out pCandidate: CANDIDATEFORM): HResult; stdcall;
function GetCompositionFontA(hIMC: LongWord; out plf: LOGFONTA): HResult; stdcall;
function GetCompositionFontW(hIMC: LongWord; out plf: LOGFONTW): HResult; stdcall;
function GetCompositionStringA(hIMC: LongWord; dwIndex: LongWord; dwBufLen: LongWord;
out plCopied: Integer; out pBuf: Pointer): HResult; stdcall;
function GetCompositionStringW(hIMC: LongWord; dwIndex: LongWord; dwBufLen: LongWord;
out plCopied: Integer; out pBuf: Pointer): HResult; stdcall;
function GetCompositionWindow(hIMC: LongWord; out pCompForm: COMPOSITIONFORM): HResult; stdcall;
function GetContext(var hWnd: _RemotableHandle; out phIMC: LongWord): HResult; stdcall;
function GetConversionListA(var hKL: Pointer; hIMC: LongWord; pSrc: PAnsiChar; uBufLen: SYSUINT;
uFlag: SYSUINT; out pDst: CANDIDATELIST; out puCopied: SYSUINT): HResult; stdcall;
function GetConversionListW(var hKL: Pointer; hIMC: LongWord; pSrc: PWideChar;
uBufLen: SYSUINT; uFlag: SYSUINT; out pDst: CANDIDATELIST;
out puCopied: SYSUINT): HResult; stdcall;
function GetConversionStatus(hIMC: LongWord; out pfdwConversion: LongWord;
out pfdwSentence: LongWord): HResult; stdcall;
function GetDefaultIMEWnd(var hWnd: _RemotableHandle; out phDefWnd: wireHWND): HResult; stdcall;
function GetDescriptionA(var hKL: Pointer; uBufLen: SYSUINT; szDescription: PAnsiChar;
out puCopied: SYSUINT): HResult; stdcall;
function GetDescriptionW(var hKL: Pointer; uBufLen: SYSUINT; szDescription: PWideChar;
out puCopied: SYSUINT): HResult; stdcall;
function GetGuideLineA(hIMC: LongWord; dwIndex: LongWord; dwBufLen: LongWord; pBuf: PAnsiChar;
out pdwResult: LongWord): HResult; stdcall;
function GetGuideLineW(hIMC: LongWord; dwIndex: LongWord; dwBufLen: LongWord; pBuf: PWideChar;
out pdwResult: LongWord): HResult; stdcall;
function GetIMEFileNameA(var hKL: Pointer; uBufLen: SYSUINT; szFileName: PAnsiChar;
out puCopied: SYSUINT): HResult; stdcall;
function GetIMEFileNameW(var hKL: Pointer; uBufLen: SYSUINT; szFileName: PWideChar;
out puCopied: SYSUINT): HResult; stdcall;
function GetOpenStatus(hIMC: LongWord): HResult; stdcall;
function GetProperty(var hKL: Pointer; fdwIndex: LongWord; out pdwProperty: LongWord): HResult; stdcall;
function GetRegisterWordStyleA(var hKL: Pointer; nItem: SYSUINT; out pStyleBuf: STYLEBUFA;
out puCopied: SYSUINT): HResult; stdcall;
function GetRegisterWordStyleW(var hKL: Pointer; nItem: SYSUINT; out pStyleBuf: STYLEBUFW;
out puCopied: SYSUINT): HResult; stdcall;
function GetStatusWindowPos(hIMC: LongWord; out pptPos: tagPOINT): HResult; stdcall;
function GetVirtualKey(var hWnd: _RemotableHandle; out puVirtualKey: SYSUINT): HResult; stdcall;
function InstallIMEA(szIMEFileName: PAnsiChar; szLayoutText: PAnsiChar; out phKL: Pointer): HResult; stdcall;
function InstallIMEW(szIMEFileName: PWideChar; szLayoutText: PWideChar; out phKL: Pointer): HResult; stdcall;
function IsIME(var hKL: Pointer): HResult; stdcall;
function IsUIMessageA(var hWndIME: _RemotableHandle; msg: SYSUINT; wParam: UINT_PTR;
lParam: LONG_PTR): HResult; stdcall;
function IsUIMessageW(var hWndIME: _RemotableHandle; msg: SYSUINT; wParam: UINT_PTR;
lParam: LONG_PTR): HResult; stdcall;
function NotifyIME(hIMC: LongWord; dwAction: LongWord; dwIndex: LongWord; dwValue: LongWord): HResult; stdcall;
function REGISTERWORDA(var hKL: Pointer; szReading: PAnsiChar; dwStyle: LongWord; szRegister: PAnsiChar): HResult; stdcall;
function REGISTERWORDW(var hKL: Pointer; szReading: PWideChar; dwStyle: LongWord;
szRegister: PWideChar): HResult; stdcall;
function ReleaseContext(var hWnd: _RemotableHandle; hIMC: LongWord): HResult; stdcall;
function SetCandidateWindow(hIMC: LongWord; var pCandidate: CANDIDATEFORM): HResult; stdcall;
function SetCompositionFontA(hIMC: LongWord; var plf: LOGFONTA): HResult; stdcall;
function SetCompositionFontW(hIMC: LongWord; var plf: LOGFONTW): HResult; stdcall;
function SetCompositionStringA(hIMC: LongWord; dwIndex: LongWord; var pComp: Pointer;
dwCompLen: LongWord; var pRead: Pointer; dwReadLen: LongWord): HResult; stdcall;
function SetCompositionStringW(hIMC: LongWord; dwIndex: LongWord; var pComp: Pointer;
dwCompLen: LongWord; var pRead: Pointer; dwReadLen: LongWord): HResult; stdcall;
function SetCompositionWindow(hIMC: LongWord; var pCompForm: COMPOSITIONFORM): HResult; stdcall;
function SetConversionStatus(hIMC: LongWord; fdwConversion: LongWord; fdwSentence: LongWord): HResult; stdcall;
function SetOpenStatus(hIMC: LongWord; fOpen: Integer): HResult; stdcall;
function SetStatusWindowPos(hIMC: LongWord; var pptPos: tagPOINT): HResult; stdcall;
function SimulateHotKey(var hWnd: _RemotableHandle; dwHotKeyID: LongWord): HResult; stdcall;
function UnregisterWordA(var hKL: Pointer; szReading: PAnsiChar; dwStyle: LongWord;
szUnregister: PAnsiChar): HResult; stdcall;
function UnregisterWordW(var hKL: Pointer; szReading: PWideChar; dwStyle: LongWord;
szUnregister: PWideChar): HResult; stdcall;
function GenerateMessage(hIMC: LongWord): HResult; stdcall;
function LockIMC(hIMC: LongWord; out ppIMC: PUserType12): HResult; stdcall;
function UnlockIMC(hIMC: LongWord): HResult; stdcall;
function GetIMCLockCount(hIMC: LongWord; out pdwLockCount: LongWord): HResult; stdcall;
function CreateIMCC(dwSize: LongWord; out phIMCC: LongWord): HResult; stdcall;
function DestroyIMCC(hIMCC: LongWord): HResult; stdcall;
function LockIMCC(hIMCC: LongWord; out ppv: Pointer): HResult; stdcall;
function UnlockIMCC(hIMCC: LongWord): HResult; stdcall;
function ReSizeIMCC(hIMCC: LongWord; dwSize: LongWord; out phIMCC: LongWord): HResult; stdcall;
function GetIMCCSize(hIMCC: LongWord; out pdwSize: LongWord): HResult; stdcall;
function GetIMCCLockCount(hIMCC: LongWord; out pdwLockCount: LongWord): HResult; stdcall;
function GetHotKey(dwHotKeyID: LongWord; out puModifiers: SYSUINT; out puVKey: SYSUINT;
out phKL: Pointer): HResult; stdcall;
function SetHotKey(dwHotKeyID: LongWord; uModifiers: SYSUINT; uVKey: SYSUINT; var hKL: Pointer): HResult; stdcall;
function CreateSoftKeyboard(uType: SYSUINT; var hOwner: _RemotableHandle; x: SYSINT;
y: SYSINT; out phSoftKbdWnd: wireHWND): HResult; stdcall;
function DestroySoftKeyboard(var hSoftKbdWnd: _RemotableHandle): HResult; stdcall;
function ShowSoftKeyboard(var hSoftKbdWnd: _RemotableHandle; nCmdShow: SYSINT): HResult; stdcall;
function GetCodePageA(var hKL: Pointer; out uCodePage: SYSUINT): HResult; stdcall;
function GetLangId(var hKL: Pointer; out plid: Word): HResult; stdcall;
function KeybdEvent(lgidIME: Word; bVk: Byte; bScan: Byte; dwFlags: LongWord;
dwExtraInfo: LongWord): HResult; stdcall;
function LockModal: HResult; stdcall;
function UnlockModal: HResult; stdcall;
function AssociateContextEx(var hWnd: _RemotableHandle; hIMC: LongWord; dwFlags: LongWord): HResult; stdcall;
function DisableIME(idThread: LongWord): HResult; stdcall;
function GetImeMenuItemsA(hIMC: LongWord; dwFlags: LongWord; dwType: LongWord;
var pImeParentMenu: IMEMENUITEMINFOA;
out pImeMenu: IMEMENUITEMINFOA; dwSize: LongWord;
out pdwResult: LongWord): HResult; stdcall;
function GetImeMenuItemsW(hIMC: LongWord; dwFlags: LongWord; dwType: LongWord;
var pImeParentMenu: IMEMENUITEMINFOW;
out pImeMenu: IMEMENUITEMINFOW; dwSize: LongWord;
out pdwResult: LongWord): HResult; stdcall;
function EnumInputContext(idThread: LongWord; out ppEnum: IEnumInputContext): HResult; stdcall;
function RequestMessageA(hIMC: LongWord; wParam: UINT_PTR; lParam: LONG_PTR;
out plResult: LONG_PTR): HResult; stdcall;
function RequestMessageW(hIMC: LongWord; wParam: UINT_PTR; lParam: LONG_PTR;
out plResult: LONG_PTR): HResult; stdcall;
function SendIMCA(var hWnd: _RemotableHandle; uMsg: SYSUINT; wParam: UINT_PTR;
lParam: LONG_PTR; out plResult: LONG_PTR): HResult; stdcall;
function SendIMCW(var hWnd: _RemotableHandle; uMsg: SYSUINT; wParam: UINT_PTR;
lParam: LONG_PTR; out plResult: LONG_PTR): HResult; stdcall;
function IsSleeping: HResult; stdcall;
end;
// *********************************************************************//
// Interface: IActiveIME
// Flags: (0)
// GUID: {6FE20962-D077-11D0-8FE7-00AA006BCC59}
// *********************************************************************//
IActiveIME = interface(IUnknown)
['{6FE20962-D077-11D0-8FE7-00AA006BCC59}']
function Inquire(dwSystemInfoFlags: LongWord; out pIMEInfo: IMEINFO; szWndClass: PWideChar;
out pdwPrivate: LongWord): HResult; stdcall;
function ConversionList(hIMC: LongWord; szSource: PWideChar; uFlag: SYSUINT; uBufLen: SYSUINT;
out pDest: CANDIDATELIST; out puCopied: SYSUINT): HResult; stdcall;
function Configure(var hKL: Pointer; var hWnd: _RemotableHandle; dwMode: LongWord;
var pRegisterWord: REGISTERWORDW): HResult; stdcall;
function Destroy(uReserved: SYSUINT): HResult; stdcall;
function Escape(hIMC: LongWord; uEscape: SYSUINT; var pData: Pointer; out plResult: LONG_PTR): HResult; stdcall;
function SetActiveContext(hIMC: LongWord; fFlag: Integer): HResult; stdcall;
function ProcessKey(hIMC: LongWord; uVirKey: SYSUINT; lParam: LongWord; var pbKeyState: Byte): HResult; stdcall;
function Notify(hIMC: LongWord; dwAction: LongWord; dwIndex: LongWord; dwValue: LongWord): HResult; stdcall;
function Select(hIMC: LongWord; fSelect: Integer): HResult; stdcall;
function SetCompositionString(hIMC: LongWord; dwIndex: LongWord; var pComp: Pointer;
dwCompLen: LongWord; var pRead: Pointer; dwReadLen: LongWord): HResult; stdcall;
function ToAsciiEx(uVirKey: SYSUINT; uScanCode: SYSUINT; var pbKeyState: Byte;
fuState: SYSUINT; hIMC: LongWord; out pdwTransBuf: LongWord;
out puSize: SYSUINT): HResult; stdcall;
function RegisterWord(szReading: PWideChar; dwStyle: LongWord; szString: PWideChar): HResult; stdcall;
function UnregisterWord(szReading: PWideChar; dwStyle: LongWord; szString: PWideChar): HResult; stdcall;
function GetRegisterWordStyle(nItem: SYSUINT; out pStyleBuf: STYLEBUFW; out puBufSize: SYSUINT): HResult; stdcall;
function EnumRegisterWord(szReading: PWideChar; dwStyle: LongWord; szRegister: PWideChar;
var pData: Pointer; out ppEnum: IEnumRegisterWordW): HResult; stdcall;
function GetCodePageA(out uCodePage: SYSUINT): HResult; stdcall;
function GetLangId(out plid: Word): HResult; stdcall;
end;
// *********************************************************************//
// Interface: IActiveIME2
// Flags: (0)
// GUID: {E1C4BF0E-2D53-11D2-93E1-0060B067B86E}
// *********************************************************************//
IActiveIME2 = interface(IActiveIME)
['{E1C4BF0E-2D53-11D2-93E1-0060B067B86E}']
function Sleep: HResult; stdcall;
function Unsleep(fDead: Integer): HResult; stdcall;
end;
// *********************************************************************//
// The Class CoCActiveIMM provides a Create and CreateRemote method to
// create instances of the default interface IActiveIMMApp exposed by
// the CoClass CActiveIMM. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoCActiveIMM = class
class function Create: IActiveIMMApp;
class function CreateRemote(const MachineName: AnsiString): IActiveIMMApp;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TCActiveIMM
// Help String :
// Default Interface: IActiveIMMApp
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TCActiveIMMProperties= class;
{$ENDIF}
TCActiveIMM = class(TOleServer)
private
FIntf: IActiveIMMApp;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TCActiveIMMProperties;
function GetServerProperties: TCActiveIMMProperties;
{$ENDIF}
function GetDefaultInterface: IActiveIMMApp;
protected
procedure InitServerData; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IActiveIMMApp);
procedure Disconnect; override;
function AssociateContext(var hWnd: _RemotableHandle; hIME: LongWord; out phPrev: LongWord): HResult;
function ConfigureIMEA(var hKL: Pointer; var hWnd: _RemotableHandle; dwMode: LongWord;
var pData: REGISTERWORDA): HResult;
function ConfigureIMEW(var hKL: Pointer; var hWnd: _RemotableHandle; dwMode: LongWord;
var pData: REGISTERWORDW): HResult;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -