Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on hook Keyboard

Status
Not open for further replies.

aryuna

Programmer
Sep 8, 2001
1
0
0
UY
I need to hook some keys (no matter what app is on focus) with Delphi 5.
I'm looking at SetWindowsHookEx and all that stuff but im completely lost !
 
#include<windows.h>
HHOOK x=0;
LRESULT CALLBACK KeyboardProc
(int code,WPARAM wParam,LPARAM lParam)
{
return 1;
}

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR,int)
{
x=SetWindowsHookEx(
WH_KEYBOARD,
KeyboardProc,
hInstance,
0
);
MSG msg;
while(GetMessage(&msg,0,0,0))
{
DispatchMessage(&msg);
}
return 0;
} Ion Filipski
1c.bmp


filipski@excite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top