>>各位能给个简单的例子吗如设置ALT+3为拼音输入法?
uses ..., Registry;
procedure TForm1.Button1Click(Sender: TObject);
var
myReg: TRegistry;
const
buf1: array[0..3] of Byte = ($01, $c0, $00, $00);
buf2: array[0..3] of Byte = ($04, $08, $01, $e0);
buf3: array[0..3] of Byte = ($33, $00, $00, $00);
begin
myReg := TRegistry.Create;
try
myReg.RootKey := HKEY_CURRENT_USER;
if myReg.OpenKey('Control Panel/Input Method/Hot Keys/00000100', True) then
begin
myReg.WriteBinaryData('Key Modifiers', buf1, 4);
myReg.WriteBinaryData('Target IME', buf2, 4);
myReg.WriteBinaryData('Virtual Key', buf3, 4);
end;
myReg.CloseKey;
finally
myReg.Free;
end;
end;
重新启动计算机,Alt+3即为全拼输入法的热键。