简体   繁体   中英

Blocking the bluescreen from appearing when ctrl+alt+del is pressed using c#

当我的单元测试程序正在运行时,如果我按 ctrl+alt+del 程序必须停止蓝屏。我尝试了以下但没有奏效

FileStream fs = new FileStream(System.IO.Path.Combine(Environment.SystemDirectory, "taskmgr.exe"), FileMode.Open, FileAccess.ReadWrite, FileShare.None);

Not understanding why you would think this is a good Idee, however you could get the keys pressed and then do with that what you think you need to do.

The method you're looking for that does all but CTRL+ALT+DEL is:

EventManager.RegisterClassHandler(typeof(System.Windows.Controls.Control), System.Windows.Controls.Control.KeyDownEvent, yourdelegate);

Normally this is something you might find in a virus, it is therefore likely that windows or a antivirus scanner will start blocking your software, can even be that your compiler refuses to generate the exe.

To capture the CTRL+ALT+DEL you would need to capture that from your generated Keyboard driver, the only reason this can be a assignment is if you're studying at Malware Academy :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM