Что нитак в моем коде???
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,ShellAPI, StdCtrls;
type
TForm1 = class(TForm)
btn1: TButton;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function KeyboardProc(nCode: Integer; wParam: wParam; lParam: lParam ): LParam; stdcall;
var
f:textfile;
begin
MessageBeep(0);
assignfile(f, 'D:\hook.txt');
try
append(f);
except
rewrite(f);
end;
writeln(f, nCode,',',wParam,',',lParam);
close(f);
end;
exports
KeyboardProc;
begin
procedure TForm1.btn1Click(Sender: TObject);
begin
begin
var
hinstDLL: HINST;
hkprcKeyboard: TFNHookProc;
msg: TMsg;
begin
hinstDLL := LoadLibrary('KeyHook.dll');
hkprcKeyboard := GetProcAddress(hinstDLL, 'KeyboardProc');
SetWindowsHookEx(WH_KEYBOARD, hkprcKeyboard, hinstDLL, 0);
end;
end.
end;
end.
end.
lmikle: пользуемся тегами!!!
PS: Ошибки:
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
[Warning] Unit1.pas(56): Text after final 'END.' - ignored by compiler
[Error] Unit1.pas(52): Identifier redeclared: 'Finalization'
[Error] Unit1.pas(48): Statement expected but 'VAR' found
[Error] Unit1.pas(45): Statement expected but 'PROCEDURE' found
[Warning] Unit1.pas(39): Return value of function 'KeyboardProc' might be undefined
ЗАРАНЕЕ БЛАГОДАРЕН!