Possible to disable Control-Alt-Delete buttons?

First off, I have searched on google and have not found any answers, and all of the folks who have asked in the archives basically got a "why on earth would you want to do that " or, "Only reason to do that would be to spread a virus!", etc responses.

So here's the background:

I'm an instructional designer/developer tasked with implementing a certification program for my company. This includes a series of examinations, similar I would imagine to Microsoft's cert exams and other companies. However, unlike Microsoft and others, my company is unwilling to spend the $70k minimum per year to contract a testing center network to administer the exams and proctor them, etc.

I originally (and unless I can get this to work will continue with this plan) was going to just use an online exam via a web browser. This is not totally legitimate from an exam integrity standpoint though because the examinee could simply minimize the browser with the exam in it and then have an instance of the software that they are being tested on open and search for answers in the help, etc while they are taking the exam. Not good : ( While there is no real way, outside of an in-person proctored examination, to ensure the integrity of the exam I would like to make it as difficult as possible for someone to be tempted to cheat.

I use Macromedia (Adobe) Breeze, which is a web-based training and exam administering learning management system. I am skilled in coding in Flash (yes, coding - not banner ads : ). I decided to try to learn C# on my own and after having been at it a few evenings I'm loving it and am close to having all of the forms and code I need for a little "testing" shell that basically is just one big form that has some introductory information and checkbox and some login fields. Then when they click on a "Start Exam" button a WebBrowser control is made visible and loads in an online exam that is hosted on Breeze. Since the form is maximized by default (and the resizing buttons in the top-left of the form are disabled), this makes it so that the only way for the user to exit the program is to either click on the File --> Exit dropdown menu or they can use Control-Alt-Delete and minimize the program.

So my question is: how could I disable control-alt-delete so that they could only use the dropdown menu's Exit option to quit the program (which would then send a signal to Breeze, via my code, that the user has stopped the exam)

Any help is greatly appreciated.

mark


Answer this question

Possible to disable Control-Alt-Delete buttons?

  • Newmer60

    well... as you said .. ypu really need some security their in order for no cheating..

    what i would do :


    1) hook keyboard.. so no alt+f4 or other keys.. to escape
    2) while the user takes the test rename the taskman.exe to something else.. then rename it back
    3) set the main form on lost focus to regain imediatly focus
    4) set the main form to full screen
    5) dissable windows button
    6) set form to top most


    doing all this will provide you some security.. but its not enought a good programer can create tools to trick you..

    i think what will best do :

    1) do the other steps
    2) run your application in RUNONCE this will start your application before desktop loads.. and before RUN keys are started.. in fact few process are started before yours.. and it will keep that until your application exits.. and the continue as ussual.. showing desktop.. running things. (RunOnce and Run are registry values)


  • snowbound

    To prevent user opening a Task Manager window for the duration of your application, you would require a global CBT-type hook to monitor the creation of all windows. If the window's caption is something like 'Task Manager' then return the appropriate result code to prevent creation of that window. This would require a global hook and not a local hook, since you would want to monitor all processes - in turn this requires the hooking code to live in a DLL which can be injected into each process space as required. During my past web serving, I've seen several of these hopoking libraries written in Managed C. You should search for these and also read up on hooking in general and CBT-type hooks in particular.

    Regards,

    John.


  • phenshaw

    Lcode...very nice solution.

    As far as the CBT hook (globally)...I have noticed (XP,2000)...that an icon will appear in the tray...before you close or suprpess the create message. Not fully tested...but hopefuly a workaround is out there.



  • Noam02

    Yes...you wil get some very confusing "hints" with a question like this.

    In your situation...I don't think it's nessasary to know if they close the app with ctrl alt del.

    If the task manager appears...that may be enough to identify a possible cheater...and you can stop the exam right there.

    private void timer1_Tick(object sender, EventArgs e)

    {

    int taskManager = FindWindow("#32770", "Windows Task Manager");

    if(taskManager != 0)

    //take some action

    }

    As far as I know the key combo cannot be disabled.

    http://www.desaware.com/products/universalnet/spyworks/features.aspx

    With a third party control (like the link above) you can detect when the 3 key combo is typed.

    You could also detect the button_click event of the "End Process" button on the task manager form...and possibly discard the message so that no process can be killed (have not tried that yet)...but I have with other "buttons".



  • Giri Nair

    A few more hints:

    whenever another window is opened (including the Task Manager), your window gets a Deactivate event. For instance:

    private void MyForm_Deactivate (...) {
    Activate ();
    BringToFront ();
    Focus ();
    }

    This will already help keeping your window on top of most others, but it might be nice to check for presence of windows that shouldn't be there. Since this event shouldn't arrive too often, you can take the time to check all the top-level windows via the EnumWindows API. There is a simple example here.

    Finally, to avoid your window being minimized, you can check the Resize event:

    private void MyForm_Resize (...) {
    if (WindowState != WindowState.Maximized)
    WindowState = WindowState.Maximized;
    }

    HTH
    --mc


  • yi peng

    Being a little curious about this particular topic ...I decided to spend a little time on it.

    It is possible to "disable" showing the taskmanager. Not to say disabling CAD without gina...but it is very possible to make sure the taskmanager never appears onscreen...and exits gracefully without a chance to kill a process.(even with repeated stabs at cad).

    I've created a Usercontrol that uses:

    Global WH_SHELL hook; ...and a timer.

    It can be done.



  • TheGunShow

    Another way is to start the taskmanager hidden.(can't kill a process) and if the key combo is hit again..it will stay hidden.

    Then close it when the exam is done.

    [DllImport("user32.dll")]

    public static extern int FindWindow(string lpClassName, string lpWindowName);

    [DllImport("User32.dll")]

    public static extern Int32 SendMessage(

    int hWnd, // handle to destination window

    int Msg, // message

    int wParam, // first message parameter

    int lParam); // second message parameter

    private void Form1_Load(object sender, EventArgs e)

    {

    Process p = new Process();

    p.StartInfo.WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.System);

    p.StartInfo.FileName = "taskmgr.exe";

    p.StartInfo.CreateNoWindow = true;

    p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

    p.Start();

    }

    private void Form1_FormClosing(object sender, FormClosingEventArgs e)

    {

    const int WM_CLOSE = 0x0010;

    int taskManager = FindWindow("#32770", "Windows Task Manager");

    SendMessage(taskManager, WM_CLOSE, 0, 0);

    }



  • tech2hardikjoshi

    You may want to think about creating a virtual desktop that spawns when the test is started. Just spawn the test program alone on that desktop and even if they were to hit C+A+D it would only appear on the default desktop which would be unavailable to them. Setup your own super secret Hotkey combination to get back to the deafult desktop. This will also help you lock out most users from even attempting to change anything.

    Check out this section for more information on setting it up.

    http://msdn.microsoft.com/library/default.asp url=/library/en-us/dllproc/base/openwindowstation.asp

  • MichaelM

    If you must disable Ctrl-Alt-Delete, search Google for Gina Stub or look at these links:

    http://www.dotnet247.com/247reference/msgs/36/181489.aspx

    http://msdn.microsoft.com/library/default.asp url=/library/en-us/vcsample98/
    html/vcsmpginastubsample.asp frame=true




  • Jignesh Desai

    maybe using "SystemParametersInfoA" might help, if you tell the system that the screensaver is running the c-a-d combo does not work

    see this old example...

    http://www.leahcim.com/visualbasic/progs/block.bas


  • Possible to disable Control-Alt-Delete buttons?