计算机二级辅导:delphi程序恢复ctrl+space切换输入法
来源:优易学  2011-6-7 12:30:23   【优易学:中国教育考试门户网】   资料下载   IT书店
  源程序如下:有注释
  unit Unit1;
  interface
  uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,registry;
  type
  TForm1 = class(TForm)
  Button1: TButton;
  procedure Button1Click(Sender: TObject);
  private
  { Private declarations }
  public
  { Public declarations }
  end;
  var
  Form1: TForm1;
  implementation
  {$R *.dfm}
  //注册表 HKEY_CURRENT_USER\Control Panel\Input Method\Hot Keys\00000010 KeyModifiers=02C00000 Ctrl+Space; 06C00000 Ctrl+Shift+Space
  procedure TForm1.Button1Click(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.

责任编辑:小草

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训