0

I'm making a program that needs to block all input during a short critical section. I used BlockInput, but it still allows the user to use hotkeys like Ctrl+Alt+F1 or Ctrl+Alt+F2 (switching taskbar in both displays). It is crucial that the user is not able to use these two hotkeys.

I read some things about a hook, but I'm not sure where to start with this solution. Any help would be greatly appreciated.

Thanks!

  • Possible duplicate http://stackoverflow.com/questions/4529577/disable-control-alt-delete-and-windowswin-key-in-windows-7-using-win32-app – Sanja Melnichuk Jan 11 '11 at 15:38

1 Answers1

1

A keyboard hook could do the trick - check out SetWindowsHookEx. Note that it gets tricky on 64-bit systems.

But may I suggest simply setting your process/thread priority to some ludicrously high value? Windows will really favor your process then, and at the highest settings even keyboard and mouse stopped working - I found that out the hard way. :)

Vilx-
  • 104,512
  • 87
  • 279
  • 422