Hossain 0 Posted October 15, 2009 Report Share Posted October 15, 2009 HI guysCould anyone point me to the direction of some Tutorials on how to Hook the keyboard usings the windows PAI to capture keystrokes,I want to enable my App to Bring itself too top if certain key combo is pressed, mainly because i want to give the option for my application to hide <its a to do list app> when user click Hide button. But i have no real way of havign it charm Form1.hide;toForm1.show; unless i can moniter all Keyboard strokes.I know its posible and have been told not too hard. and i know that it wil lrequire building a DLL, buti just dont know how to code it Thanks Ad-link removed - mps69 Link to post
matonga 0 Posted December 30, 2009 Report Share Posted December 30, 2009 Maybe this helps:http://msdn.microsoft.com/en-us/library/ms646309(VS.85).aspxSome notes:HWND -> Form1.HandleIn your form add this to FormCreate procedure:// For example Win+Shift+A// 100 or whatever you want, if you register many hotkeys you must put a unique id to each oneRegisterHotKey (Handle, 100, MOD_WIN Or MOD_SHIFT, VK_A);In your form add this to interface section:procedure FormHotKey (var msg : TWMHotKey); message WM_HOTKEY;In your form add this to implementation section:procedure FormHotKey (var msg : TWMHotKey);begin If msg.ID = 100 Then Show;end;Of course this is just quick & dirty. For other techniques you'll need a .dll etc... for sure, this is just the simplest alternative.PS: I didn't test the code, so it may have syntax errors. Link to post
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now