how to create non window bound keyboard shortcuts

前端 未结 4 1286
故里飘歌
故里飘歌 2021-01-23 10:22

I\'m creating a C# application, could be WinForm, but preferably console application, which needs to capture keyboard shortcuts even when the application is not in the foregroun

4条回答
  •  无人及你
    2021-01-23 11:03

    This can be done via a Low-Level Keyboard Hook via a Windows Hook trapping WH_KEYBOARD_LL.

    Here is a CodeProject article on setting up a Global Hook in C# which demonstrates the entire process.

提交回复
热议问题