[.net] .net full screen non-switchable application

Started by
7 comments, last by mutex 17 years, 1 month ago
i want to automatically start my app when windows starts(in fullscreen mode)and then prevent the user from switching to another application.(neither Alt+tab nor windows key will switch to another applicaition) How can i do this in c#
Essegin Ziki:) bunu bu sitede imza hesabına yazsam kimse anlamaz!!!:)
Advertisement
i'm usually not the kind to assume by default that questions are aimed at a bad use but seeing how this is worded.... why do you need to do that?
Quote:Original post by tonymontana
How can i do this in c#


You don't. [grin]

Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development

I have to do this because my boss said so..I won't do any harm to anyone's system.But the program i will write must be topmost(it is now) but also non-switchable(it is not now).How can i get support for this from OS in .net
Essegin Ziki:) bunu bu sitede imza hesabına yazsam kimse anlamaz!!!:)
www.google.com :-)
Quote:Original post by tonymontana
I have to do this because my boss said so..


Your boss is an idiot. Feel free to tell him I said so. [grin]

There's no justifiable reason to implement such functionality in a business application and even games shouldn't do this as it's almost trivial to handle app switching.

Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development

There is one reasonable reason why anyone wants this:

For some sort of Kiosk Application. But even there, allowing desktop access, and then using group policy to restrict everything is the more solid solution. Thats the way I've done before and doing right now again.
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

The answer you're looking for is somewhere between "You don't." and "You can't."

While you can (I believe) catch Alt+Tab on all current versions of Windows, it's not recommended. ("You don't.")

Users can also switch tasks with Ctrl+Alt+Del, and you can't catch that, because it throws a hardware interrupt that is only available to programs running in ring 0. ("You can't.")
Like others here, I think disabling input like that is a bad idea. What if they press Ctrl+Shift+Esc to start Task Manager then kill your app? What if they press Ctrl+Alt+Del to reach the lock screen and start Task Manager that way?

davepermen's solution seems best, but if you can't convince your boss otherwise, see this article on setting up a windows hook. Specifically you'll want a keyboard hook that eats Alt+Tab, Windows key, Ctrl+Shift+Esc, etc. Note that you can't eat Ctrl+Alt+Del; that combo is detected only by the OS.

This topic is closed to new replies.

Advertisement