C# windows app Keyboard hook SetWindowsHook

G

Guest

Hi
I have to prevent user pressing Alt, Ctrl, Shift and Windows+M key combinations when the windows form created by the application is active. The main thread runs in background and the entire application is like a Wizard where user keeps on pressing Ok / Cancel and the next form is opened after closing the previous one

I have to prevent user from pressing all special keys, user should not be able to minimise the app etc

How do I do that

I tried SetWindowHookEx(...) but that did not work

Also in WinUser.h has
#define WH_KEYBOARD 2 an
#define WH_KEYBOARD_LL 1

The Hook can be created using WH_KEYBOARD but not WH_KEYBOARD_LL

The hook created using WH_KEYBOARD does not work.
Can some one help me in providing a small snippent of code

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top