I’ve been working on a till/cash-register application. We need to prevent the users from quitting the application by using Alt + Esc, Ctrl + Alt + Del or Alt + Tab etc combinations and we’ll be providing a separate custom hotkey for quiting. The application will be full-screen and without any close button. I’ve already done the full screen no cross button part but stuck with disabling the low system level hotkeys. How do I do this in C#? Any help or alternative methods (ie. setting up user group permissions to prevent star menu/task manager or any other alternative to achieve the goal) are appreciated.
Edit: We’re using WinForms. The application will run in Windows XP/Vista/7.
There is no direct way to escape from the standard behavior of Windows. A user of Windows must have the possibility to kill applications. If the application doesn’t obey, the system will force-kill the application.
However, there are a few tricks, often employed by virus-writers, here are some (not extensive):
explorer.exeto get rid of your application.WM_CLOSE,WM_EXITorWM_KILLmessage and simply continue “living”.But, general advice: don’t do this. Allow your users to potentially kill the program if needed, otherwise it will be very hard to do any maintenance. The only “supported” way is through services, where you can allow special users to stop your service and it cannot be stopped through task manager.