以下是代碼片段:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,registry;
type
TForm1 = class(TForm)
btn1: TButton;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btn1Click(Sender: TObject);
var
reg :TRegistry;
buffer :array[0..3] of Byte;
begin
//setLength(buffer,3);
buffer[0]:= $02;
buffer[1]:=$c0;
buffer[2]:=$00;
buffer[3]:=$00;
reg:=TRegistry.Create;
reg.RootKey:=HKEY_CURRENT_USER;
if(reg.OpenKey('\Control Panel\Input Method\Hot Keys\00000010',false)) then
begin
reg.WriteBinaryData('Key ModifIErs',buffer,4);
showmessage('ok');
end;
reg.Free;
end;
end.