1

We are currently working on a Fullscreen application in C#. It is a quiz application which is going to be used in a school to evaluate students.

We presently can put application to a fullscreen state without topbar and border. The thing is the student can still switch between windows and use Windows native commands such as CTRL-ALT-DELETE and CTRL-SHIFT-ESC. Oh and ALT-TAB.

We were wondering if there was a way to block these commands without anti-viruses reporting the app as a threat. Well, first of all if there was a way to simply block the commands. We doupt it is but you guys often come up with some astonishing solutions to nearly unsolvable problems so we thought we might ask anyway.

Thanks for your concern, hopefully someone will come up with something good.

EDIT :

We want to do this so that students can't kill the app with Taskmanager and so that they can't open any other app like an internet browser or chat utility. Maybe there's a more secure way to do things?

6

3 Answers 3

2

You actually can't do this from code in windows xp and windows 7.

Here is a way to do this via the registry: Securing Windows For Use As A Kiosk

1

Can't you just set the forms TopMost property to TRUE and hide all form controls. All ctrl-alt-del etc. allows you to do is shut down the process/app. If this what you are trying to avoid then ignore this answer.

The other answer is to use a global keyboard hook:

[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
    private static extern IntPtr SetWindowsHookEx(int idHook,
        LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId);

    [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
    [return: MarshalAs(UnmanagedType.Bool)]
    public static extern bool UnhookWindowsHookEx(IntPtr hhk);

    [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
    private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode,
        IntPtr wParam, IntPtr lParam);
1

Why not build your app in asp.net to run in the browser and set the computer into "kiosk" mode via group policies? You can run IE in fullscreen that way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.