Hi,
I recently upgraded my machine to Vista, and am loving it! Finding it nice and light, and the UI is really great so hats off!
At the moment I'm prototyping a kiosk type Windows Forms application to run on Vista. I can start the application running on O/S load by modifying the following reg key to point to my application rather than Explorer.exe:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
The next thing I need to do is to stop the User breaking out of my application once it's running, so I'll need to disable key combinations like ALT+F4, CTRL+ALT+DEL etc...
I found a great article on how to do this on XP here:
http://www.codeguru.com/columns/VB/article.php/c4831/
The code allows you to hook the keyboard to catch certain key combinations, in this example ATL+TAB, ALT+ESC and CTRL+ESC. I've been playing round with the code on Vista, and have come up with the following behaviour:
The only one that is kind of working is the ALT+TAB - the code catches the combination and most of the time the window does not switch, but sometimes even though the code catches the combination the focus shifts to the next window (for example if you press it in a few times in quick succession). For ALT+ESC, the code catches the combination but focus still shifts to the next window, for CTRL+ESC the code catches the combination but the Start Menu appears (similar to pressing the Windows key).
There may of course be another way around this using managed code in .NET 2005 (the example above uses the Windows APIs SetWindowsHookEx, GetAsyncKeyState and CallNextHookEx).
The question is do you know any way on Vista to programmatically intercept key combinations like ALT+F4, CTRL+ALT+DEL? (seeing this low-level way is not really working)
Thanks
I recently upgraded my machine to Vista, and am loving it! Finding it nice and light, and the UI is really great so hats off!
At the moment I'm prototyping a kiosk type Windows Forms application to run on Vista. I can start the application running on O/S load by modifying the following reg key to point to my application rather than Explorer.exe:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
The next thing I need to do is to stop the User breaking out of my application once it's running, so I'll need to disable key combinations like ALT+F4, CTRL+ALT+DEL etc...
I found a great article on how to do this on XP here:
http://www.codeguru.com/columns/VB/article.php/c4831/
The code allows you to hook the keyboard to catch certain key combinations, in this example ATL+TAB, ALT+ESC and CTRL+ESC. I've been playing round with the code on Vista, and have come up with the following behaviour:
The only one that is kind of working is the ALT+TAB - the code catches the combination and most of the time the window does not switch, but sometimes even though the code catches the combination the focus shifts to the next window (for example if you press it in a few times in quick succession). For ALT+ESC, the code catches the combination but focus still shifts to the next window, for CTRL+ESC the code catches the combination but the Start Menu appears (similar to pressing the Windows key).
There may of course be another way around this using managed code in .NET 2005 (the example above uses the Windows APIs SetWindowsHookEx, GetAsyncKeyState and CallNextHookEx).
The question is do you know any way on Vista to programmatically intercept key combinations like ALT+F4, CTRL+ALT+DEL? (seeing this low-level way is not really working)
Thanks