Sep 8, 2001 #1 aryuna Programmer Sep 8, 2001 1 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 !
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 !
Sep 10, 2001 #2 Cagliostro Programmer Sep 13, 2000 4,226 GB #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 filipski@excite.com Upvote 0 Downvote
#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 filipski@excite.com