Páginas

Google
 

quarta-feira, 6 de maio de 2009

Aplicação pratica pra key log - abrir gaveta

unit Unit1;

interface

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

type
TForm1 = class(TForm)
Timer1: TTimer;
Button1: TButton;
Label1: TLabel;
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
Procedure AbreGaveta;
end;

var
Form1: TForm1;

const
ESC = chr($1B); // Escape global...
GavBematech = ESC+chr($76)+chr($80); // Abre gaveta bematech

implementation

{$R *.dfm}

procedure TForm1.AbreGaveta;
var F:TextFile;
begin
AssignFile(F,'LPT2');
Rewrite(F);
Writeln(F,GavBematech);
CloseFile(F);

end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
keyloop, KeyResult : Integer;
begin
keyloop := 0;
repeat
KeyResult := GetAsyncKeyState(keyloop);
if KeyResult = -32767 then
begin
case keyloop of
123: AbreGaveta;
end;
end;
inc(keyloop);
until keyloop = 255;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
AbreGaveta;
end;

end.

Um comentário:

Unknown disse...

Otimo Funcionou e ainda melhor sem dll