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,242
  • 4
  • 18
  • 32

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,252
  • 3
  • 32
  • 42
0

Several places to start looking:

Community
  • 1
  • 1
Victor Zakharov
  • 24,856
  • 17
  • 77
  • 143