Who can help me about hooks using hot-key?
-
I read MSDN about hooks, but I dont know how to write the filter function to take hot_key. Ex: Ctrl + W --> Microsoft Word opens Ctrl + P --> play CD player ... Hope to recieve your guide ! Thank you NewTan
First of all, you'll have to make a dll to set a system-wide hook. In this dll you'll have to register your keyboard hook procedure. Your hook function will be called on every keypress the user makes, so at that point you check what key has been pressed and with the function 'GetAsyncKeyState' you can see wether ctrl, alt or one of the shift keys is down as well. Next, you'll have to create an application which loads the dll and call a function in the dll to register the hook procedure (if not done by loading the dll). If you want to keep things clean you should have a funtion in your dll to unhook your thing if you no longer need it, or close your app... Don't think you are, know you are...