I don't understand how to set keyboard hooks. Can someone simplify?

I don't understand how to set keyboard hooks. Can someone simplify?
http://msdn2.microsoft.com/en-us/library/ms644960.aspx
http://www.codeproject.com/dll/keyboardhook.asp

All I want to know is how to set a keyboard hook for the "F2" button.
And how to show a messagebox everytime "F2" is pressed.
If someone writes a code that does only that I think I can understand.

Thank you for your help
//ColacX

Comments

  • Also posted at Beginner C/C++.
    bilderbikkel
  • Okay anyway I weren't sure where to post but I'm choosing here now.
    So about KeyBoard Hooks.
    I've found out that creating a keyboard hook is a term for installing a procedure in between windows message procedures.
    This hook is supposed to message my application whenever it is triggered.
    Also possible to uninstall procedures.
    To Install a hook you need to create a DLL, Dynamic Link-Library.

    Using SetWindowsHookEx()to set the hook.
    And LRESULT CALLBACK HookProc() to retrive the hook.

    How do I code an one key hook? For example "F1".
    How is the DLL supposed to look like?

    //Nothing Important takes long to say.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories