Prevent Alt+Tab in fullscreen

Blitz3D Forums/Blitz3D Programming/Prevent Alt+Tab in fullscreen

RepeatUntil(Posted 2005) [#1]
Hi,

I know that it has been discussed a few times in the past. but my search shows that there was no good answer.
I want to prevent players from alt-tabbing when in fullscreen (my game is multiplayer and crash the client if it happens).
I tried the function GetActiveWindow() from user32 but it works only for windowed mode.
I tried to catch the alt and tab key with KeyDown() but there are impossible to catch (windows catch them first).

So what to do, what to do? Is there some tricks using another function in user32 (or some other userlibs)??


RGR(Posted 2005) [#2]
Searching for this you find several ways to realize this.

It should work using SystemParametersInfo - but I did not get it running in Blitz3D Fullscreen yet.

Another way is SetWindowsHookEx - and besides I didn't get it to work yet either this one is quite complicated and for that reason it may be not universal enough anyway.

In one Forum a guy wrote about patching the registry - with the risk that your admin rights on your computer may be gone...

What I am doing occasionaly (needing this feature for a program also) is looking at PowerBasic and PureBasic Codearchieves - I am pretty sure that there will be a dll somewhere ready to use.

Btw: GetActiveWindow works in Fullscreen too, and using GetWindow you can even find all (about 4 times more than Task Manager shows) 200 Tasks (PseudoWindows / Processes) an average computer system is running in the background; GetWindowText displays the names if they have one...
One of those is the keyboardhandler ... but which one and would it be possible to manipulate it? No idea ;-)

If I have found something I'll tell you


RepeatUntil(Posted 2005) [#3]
I am surprised that a so common problem has not found a solution yet!!


smilertoo(Posted 2005) [#4]
I think its deliberatly hard, if the game crashes and you cant alt/tab or get to task manager you're pretty well screwed.