0

I want to essentially absorb key presses.

I'm currently using key preview on my main form and have an event handler for a key press that checks if the windows key is pressed. Is there a way to prevent the key press for leaving the application and opening the start menu?

There is an option for specific controls to suppress a key press, is there a way to suppress a key press to Windows?

NMunro
  • 1,282
  • 4
  • 18
  • 33

2 Answers2

0

The only way to intercept keyboard events outside your application is with P/Invoke SetWindowsHookEx. This will set a global callback to keyboard events agnostic of the focused application.

Brandon Moretz
  • 7,512
  • 3
  • 33
  • 43
0

Several places to start looking:

Community
  • 1
  • 1
Victor Zakharov
  • 25,801
  • 18
  • 85
  • 151