-2

Is there any way to block CTRL+ALT+DEL too when using BlockInput(true); in Delphi? I've found a function SystemParametersInfo(97,Word(True),@OldValue,0); but it doesn't work on XP.

I need this for my classroom in the university to temporarily "BAN" students, who are trying to cheat computerized tests.

Edit:

Well, ok. The result of while true do BlockInput(true) + NoClose + NoLogoff, DisableTaskMgr + DisableLockWorkstation + DisableChangePassword is partly acceptable. With this banned user can only press "Cancel" on the Security screen, and get an error, if he/she try to press a CTRL + SHIFT + ESC on this. But this is not very clean way to do this, I think, so the question about blocking all input is still active.

Suggested solutions:

  • Key remapping - requires reboot, remapped keys not working properly
  • Gina DLL replacement - requires some major knowledge in C++ to have needed functionality, please provide more info or a link to a working sample
  • KB Driver replacement - may not work with some keyboards and Windows is trying to replace it back after reboot
  • Nothing to do with this - not actual truth because of some apps, which can do this without a reboot or gina replacement
  • Abhishek
    • 6,912
    • 14
    • 59
    • 85
    Goover
    • 380
    • 1
    • 3
    • 13
    • I don't think this is achievable just from user privileged application, as _Three Kings_ are sew in deeply into guts of Windows. For what I know about them, they're handled at keyboard driver level, before any keyboard mapping or input handling. There are methods to suppress them by additional drivers or I expect there is a policy setting available. You have to squeeze uncle Google more. – Michał Fita Jun 14 '13 at 07:58
    • 1
      See [`Disable Ctrl-Alt-Del and shutdown for kiosk`](http://stackoverflow.com/q/4234242/576719). – LU RD Jun 14 '13 at 08:12
    • Thanks for the comments, but key remapping is not an option since it require a reboot to take effect and I don't want to remap that keys forever. As for the additional drivers I really don't understand how to do this, am I need to replace an original driver of a keyboard to that one in runtime and switch it back if needed, this driver will be installed to the system and act as a simple KB driver with additional possibilities? – Goover Jun 14 '13 at 09:24
    • ...it back if needed, _OR_ this... – Goover Jun 14 '13 at 09:33
    • 1
      You should fix the real problem. Blocking CTRL+ALT+DEL is not the solution that you need. – David Heffernan Jun 14 '13 at 11:35
    • 1
      I fail to see how that keystroke enables someone to cheat. What enables people to cheat is the ability to run other programs, and what enables that is Task Manager. What you should do, therefore, is [disable Task Manager](http://support.microsoft.com/kb/555480). – Rob Kennedy Jun 14 '13 at 13:13
    • @RobKennedy They are cheating using mobile devices or their notebooks or some other sources or just talking loudly, politics is that, that if a teacher see this he or she must have an ability to stop any actions from this student for some time... something like that. Well the real problem is that I want to be able to stop student from acting for some time as a punishment for cheating, 10% of test's time, for example – Goover Jun 17 '13 at 08:10
    • So, entirely unrelated to Ctrl-Alt-Del then. – MSalters Jun 17 '13 at 09:05
    • @MSalters should I tie them to a chair? – Goover Jun 17 '13 at 09:43
    • Disabling that keystroke gets you no closer to *any* of what you describe. The usual punishment for cheating is immediate failure. If you want to disable the test for some amount of time, then do that, but know that Ctrl+Alt+Del is neither the problem nor the solution. – Rob Kennedy Jun 17 '13 at 12:27
    • @RobKennedy Our test system don't have a functionality to stop clients from acting, or to end a test client-side. Can you advice me a tactic to achieve what I need? I mean, there is no built-in ability to do this, so I'm creating an external programm. – Goover Jun 18 '13 at 06:16
    • I don't understand what problem you're still trying to solve. You don't need to block the SAS because that keystroke does not allow cheating and it does not allow circumvention of your cheat-blocking program. If you really must, and you're targeting Windows XP, then you can replace the GINA DLL. It doesn't require deep C++ knowledge; it requires only basic C knowledge, the same as is required for *any* Windows programming, and it can be written in Delphi. Search engines show many results about the endeavor. – Rob Kennedy Jun 18 '13 at 12:48

    1 Answers1

    1

    No. Ctrl+Alt+Del is the Secure Attention Sequence. It's called Secure because the OS always handles it internally. Applications cannot override that.

    In your case, you don't need to block it anyway. It's not a sequence you type in by accident. Therefore, it's sufficient to detect it. E.g. it would be the only way in which your app would lose focus. So, tell your students not to do it, and fail the test if they still try.

    Mwiza
    • 7,780
    • 3
    • 46
    • 42
    MSalters
    • 173,980
    • 10
    • 155
    • 350
    • Actually, there is one or more apps, which can break your strong and imperative answer. NetOp School, for example. It can block ALL input on student computer including CTRL+ALT+DEL, when you are in remote control mode. – Goover Jun 14 '13 at 09:30
    • And yes, students don't type this sequence by an accident, they try to escape their BAN using this keys – Goover Jun 14 '13 at 09:37
    • @Goover How can you be sure that NetOp School doesn't install a kernel driver? – David Heffernan Jun 14 '13 at 11:36
    • 1
      If this is Windows XP, it wouldn't need to, @David. All it would need to do is install its own [gina DLL](http://stackoverflow.com/q/1660106/33732). No drivers required. – Rob Kennedy Jun 14 '13 at 13:04
    • @DavidHeffernan I'm not sure, how it's done here. This app got a DLL called `inputHook.dll` (I've tried to access exported functions of it, but it seems doesn't work or I send wrong parameters to it), no any replacements of gina.dll as far as I can see, also there is a helper service in system. Actual blocking is looks the same, as `BlockInput(true);` (keyboard and mouse is powered, but not responding) except of nothing happens, when user presses that nasty combination. As for the gina dll, I think I'll fail properly recompiling it, so I'll just look for a already compiled version. – Goover Jun 17 '13 at 08:23