?? ime.pas
字號:
unit ime;
interface
uses SysUtils, WinTypes, WinProcs, Dialogs;
type
// 必要的類型聲明
TDateNTime = record
wYear, wMonth, wDay: word;
wHour, wMin, wSec: word;
end;
TImePro = record
hWndIme: HWnd; { IME handle }
dtInstDate: tDateNTime; { Date and time of installation }
wVersion: word; { the version of IME }
szDescription: array[0..49] of byte; { Description of IME module}
szName: array[0..79] of byte; { Module name of the IME }
szOptions: array[0..29] of byte; { options of IME at startup}
fEnable: boolean; { IME status; True=activated,False=deactivated }
end;
pTImePro = ^TImePro;
function SetIme(const sImeFileName: string): boolean; far;
implementation
// 調(diào)用 winnls.dll export 函數(shù)的聲明
function ImpSetIme(hWndIme: HWND; lpImePro: pTImePro): boolean;far; external 'winnls.dll';
// --------------------------------------------------
// SetIme(const sImeFileName: string): boolean;// 切換到某一特定的輸入法
// 傳入?yún)?shù): sImeFileName--輸入法 IME 文件名, 例: winpy.ime; 若為空字串: 英數(shù)輸入法
// 傳回值: True--切換成功, False--失敗
function SetIme(const sImeFileName: string): boolean;
var pImePro: pTImePro;
MaxAvail: Integer;
begin
Result := False;
if MaxAvail < SizeOf(TImePro) then
begin
MessageDlg('內(nèi)存不足', mtWarning, [mbOk], 0);
Exit;
end
else
begin
New(pImePro);
try
if sImeFileName = '' then (* 空字串, 還原到英數(shù)輸入法 *)
pImePro^.szName[0] := 0
else
StrPCopy(@pImePro^.szName, sImeFileName);
Result := ImpSetIme(0, pImePro); (* 調(diào)用 ImpSetIme *)
finally
Dispose(pImePro);
end; { of try }
end;
end; { of SetIme }
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -