Mega Code Archive

 
Categories / Delphi / Examples
 

Trapping win-e shortcut to explorer for a kiosk application

Question: I'm trying to prevent an NT workstation user from being able to use any and all non-alphanumeric keys on the keyboard. More preciselly, I'm trying to trap all the Win (Start Key) shortcuts, like Win-E which invokes an instance of Windows Explorer. At this point, I would settle for disabling ALL keystrokes. I am using Joe Hecht's excellent example of how to create a system-wide keyboardhook. This part works well. I am able to trap the Win key, when it is pressed by itself so that it doesn't invoke the Start menu on the desktop. But, it doesn't seem to trap the Win-E combination. Answer: A possible solution would be to define your own application to be the shell. No Explorer shell, no taskbar, no start button, no start button shortcuts... All this requires is a change to the registry key that defines the shell application. You would have to reboot to make this registry change effective or you could try to change the key and then destroy the Explorer process. If you replace the shell and kill the Explorer, it will start your application as the shell. Make sure that your application is checking whether its already in memory so that it's not running two instances. Check the 'see also' documents for more information on this one.