Вниз
Скачать: CL | DM;

SetWindowsHookEx   Найти похожие ветки 

← →
delphimun   (2003-06-18 09:22) [0]

Хочу наконец разобраться с Hookами и в ф-ии SetWindowsHookEx мне непонятны назначение последних двух параметров, вот что я там настряпал, но не работает:
unit Unit1;

interface

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

type
TForm1 = class(TForm)
Button1: TButton;

procedure Button1Click(Sender: TObject);
function MyProc(code: integer; wParam: integer; lParam: Longint): Longint; stdcall;
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
h: hhook;
begin
h:=SetWindowsHookEx(wm_keydown,@myproc,0,GetCurrentThreadID);
end;
function MyProc(code: integer; wParam: integer; lParam: Longint): Longint; stdcall;
begin
showmessage("Key is downed!");
end;
end.
Хочу, чтобы если пользователь нажал клавишу вылезло собщение, как мне реализовать это?


← →
Palladin ©   (2003-06-18 11:03) [1]

советую почитать
http://www.delphimaster.ru/articles/hooks/index.html



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.44 MB
Время: 0.01 c
14-97856
MBo
2003-06-04 17:16
2003.06.30
FAQ ;))


14-97826
Juster~
2003-06-10 23:12
2003.06.30
Обьекты, классы,...


14-97850
DiamondShark
2003-06-12 17:33
2003.06.30
Осторожно! Суеверие!


7-97912
DAT
2003-04-18 15:51
2003.06.30
Отсутствует доверие к программируемому доступу к проекту VB


3-97506
Igor Mish
2003-06-05 10:54
2003.06.30
Можно еще про Rave :-)




   Наверх