Block Control+Alt+Delete

后端 未结 14 780
渐次进展
渐次进展 2020-12-03 08:35

I am doing an Online Quiz project in C#. The test client is a Windows Desktop Application running on Windows XP. I need to block the control+alt+d

14条回答
  •  难免孤独
    2020-12-03 09:21

    I found a very ugly way of doing this (which works well). If I open taskmgr.exe exclusively, then nothing happens when the user presses Ctrl+Alt+Del.

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

    What I like the most about this solution that it has no permanent effects. For example if the application gets killed, then Ctrl+Alt+Del will just work again.

    Drawback: One must have the Welcome screen enabled or Windows Security will popup instead of Windows trying to open taskmgr and silently failing. (→ It also won't work if the machine is in a domain, because being in a domain disables the Welcome screen.)

    (Of course this won't work on Vista or W7.)

提交回复
热议问题