[英]How do I trap windows key, alt+tab, ctrl+alt+delete in C#?
如何使用C#在Windows应用程序中捕获Windows键, Alt + Tab和Ctrl + Alt + Delete ?
As Jan stated, you can't capture CTRL-ALT-DEL without writing your own GINA. 正如Jan所说,如果不编写自己的GINA,就无法捕获CTRL-ALT-DEL。
For the Windows or ALT-TAB keys, you can look at these for help: 对于Windows或ALT-TAB键,您可以查看以下内容以获取帮助:
Capturing Keystrokes without Focus (SO near-duplicate) 捕获没有焦点的击键 (SO近似重复)
How To Set A Windows Hook 如何设置Windows挂钩
Hooks (low-level, but will explain what you need for the P/Invoke) 钩子 (低级,但会解释你需要P / Invoke)
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.
如果按[CTRL] + [ALT] + [DEL],特定的Windows对话框仍将打开,但应用程序也会显示,您已按下[CTRL] + [ALT] + [DEL]并可能希望它生效在目标计算机而不是您的主机上。 It seams rather easy to capture these keys, but cancelling the Event may be harder.
它接缝很容易捕获这些键,但取消事件可能会更难。
几乎按照定义,你不能 “陷阱”ctrl-alt-delete。
AFAIK Ctrl + Alt + Delete cannot be captured using an application. 无法使用应用程序捕获AFAIK Ctrl + Alt + Delete 。
See this question to get some more idea: How to trap the keyboard strokes on ac# win forms application (CTRl + alt +Del) 看到这个问题以获得更多想法: 如何在ac#win表单应用程序中捕获键盘敲击(CTRl + alt + Del)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.