How do I trap windows key, alt+tab, ctrl+alt+delete in C#?

前端 未结 5 2088
遥遥无期
遥遥无期 2020-12-18 13:08

How do I trap Windows key, Alt+Tab, and Ctrl+Alt+Delete in a Windows application using C#?

相关标签:
5条回答
  • 2020-12-18 13:15

    Almost by definition, you can't "trap" ctrl-alt-delete.

    0 讨论(0)
  • 2020-12-18 13:20

    As Jan stated, you can't capture CTRL-ALT-DEL without writing your own GINA.

    For the Windows or ALT-TAB keys, you can look at these for help:

    Capturing Keystrokes without Focus (SO near-duplicate)

    How To Set A Windows Hook

    Hooks (low-level, but will explain what you need for the P/Invoke)

    0 讨论(0)
  • 2020-12-18 13:22

    AFAIK Ctrl + Alt + Delete cannot be captured using an application.

    See this question to get some more idea: How to trap the keyboard strokes on a c# win forms application (CTRl + alt +Del)

    0 讨论(0)
  • 2020-12-18 13:25

    You can capture Ctrl-Alt-Delete. But you need to implement your own GINA dll which is loaded by Winlogon.

    You'll need to code this up in C or C++ as it needs to be a native DLL.

    0 讨论(0)
  • 2020-12-18 13:28

    Some Remote Management Software and Virtual Machines do this. If you press [CTRL]+[ALT]+[DEL] the specific Windows Dialog will still opens, but the Application also displays, that you have pressed [CTRL]+[ALT]+[DEL] and probably wanted it t become effective on the Target Machine and not your host. It seams rather easy to capture these keys, but cancelling the Event may be harder.

    0 讨论(0)
提交回复
热议问题