简体   繁体   English

如何在C#中捕获windows键,alt + tab,ctrl + alt + delete?

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

如何使用C#在Windows应用程序中捕获Windows键, Alt + TabCtrl + Alt + Delete

You can capture Ctrl-Alt-Delete. 您可以捕获Ctrl-Alt-Delete。 But you need to implement your own GINA dll which is loaded by Winlogon. 但是你需要实现自己的由Winlogon加载的GINA dll

You'll need to code this up in C or C++ as it needs to be a native DLL. 您需要使用C或C ++对其进行编码,因为它需要是本机DLL。

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.

相关问题 C#-如何禁用热键(Ctrl + Alt + Delete除外) - c# - how to disable hotkeys (except ctrl+alt+delete) 如何在 C# 中执行保持 ALT+TAB sendkey 事件 - how to perform a hold ALT+TAB sendkey event in C# C#可见的窗口,但我不希望它们显示在Alt + Tab中吗? - C# Visible windows but I don't want them to show up in Alt+Tab? 如何在win 8中以C#编程方式按Alt + Tab - How to press Alt+Tab programmatically in C# in win 8 C#p /调用RegisterHotKey来使组合键ALT + TAB不起作用(返回0) - C# p/invoke to RegisterHotKey for the key combo ALT+TAB not working (returns 0) 如何在AC#Win Forms应用程序(CTRl + alt + Del)中捕获键盘笔触 - How to trap the keyboard strokes on a c# win forms application (CTRl + alt +Del) 如何从C#winform关闭屏幕键盘并取消所有CTRL或ALT按键 - How do I close the on-screen keyboard from C# winform and cancel any CTRL or ALT keypresses 如何拦截所有关键事件,包括 ctrl+alt+del 和 ctrl+tab? - How can I intercept all key events, including ctrl+alt+del and ctrl+tab? 如何在C#控制台应用程序中捕获修改器(ctrl,alt,shift)按键作为单键按下? - How can I capture modifier (ctrl, alt, shift) key presses as a single key press in a C# console app? 使用C#禁用没有注册表的Ctrl或Alt键 - Disable Ctrl or Alt key without registry using c#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM