i have a game in which dosent let switching task's using ALT+TAB

or any other key. Is there a way by which i can re-enable the ALT+Tab key??
Posted on 2003-05-08 01:06:44 by telophase
What you mean with "re-enable" ?
Posted on 2003-05-08 09:31:04 by bazik
DX allows the programmer to disable things like ALT-TAB (god knows why :/ ) he wants to re-enable ALT-TAB functionality.

wasn't that done with SetCooperativeLevel ?
:confused:
Posted on 2003-05-08 10:28:46 by Hiroshimator
accroding to re-enable i mean that may be the program unregister's the hotkey temporarily
Posted on 2003-05-09 08:33:13 by telophase
Well this looks like more game related but since i am not sure yet i will let it here...
want me to move it to games forum...

Yes SetCooperativeMode allows to disable Alt_Tab and even Ctrl+Alt+DEL in games...

That is good IMHO, although annoying to users ... but in a full screen exclusive game you should be imersed in game not doing some background email reading or web browsing or word processing.

The answer is NO you can not re-enable it. After all because of DX architecture game can drop the standrad Win32API message loop compleetly, and attempting to reeenable or do Alt+Tab is probably going to crash the game...

You should understand the exclusive nature of DX acces to video board/keyboard/sound and network. The game most --- likely 3D --- :( has filled video board memory with textures and stuff and has setup the pipeline with some operations in sequence. Also the resolution of game can be quite diferent from your crt desktop resolution and this requires a mode change, again clearing video memory and 3D pipeline.

IF you alt Tab --- the video memory will be probably lost (the Sureface Lost DX Error) --- and most likely ALL textures will have to be reloaded from HDD and all game resetup...this can be very time consuming making Alt+Tab a NO-NO options in high performance games or games that use very detailed and big textures (exp if JPEG that take a lot more to decode)

Even IF the tetures would be keept in system memory (damn slow, damn waste) the memory used/reclaimed by other applications / programs will most likely swap out the game memory...

SO practically big games are EXCLUSIVE LIKE applications... so thereis a very good reason for the flag in DX setup

But for debugging purposes and system recover in case of an error game programmers should allow Alt+Tab and Ctrl_Alt_Del --- IMHO we have had some probelms because not alowing this at times in HE.

What adds to this is that code to do this is somehow uncertain and i have seen many games (surely including HE) that ***sometimes*** crash or let screen in dummy resolutions or colors at alt TAB... this is another reason as no producer wants to release a game that *** sometimes *** crashes --even if rarely ...
Posted on 2003-05-09 15:44:29 by BogdanOntanu
BTW
------

This is not Task Switching is application Switching :)

And it is not a hot-key it is a system wide flag :P
Posted on 2003-05-09 15:51:29 by BogdanOntanu

That is good IMHO, although annoying to users ... but in a full screen exclusive game you should be imersed in game not doing some background email reading or web browsing or word processing.


Who are they to say what I am supposed to be doing?
Posted on 2003-05-09 17:59:10 by comrade
exactly

god forbid their stupid app crashes with a modal messagebox you have no way to activate (because of course the crashing app still has focus :rolleyes: ) but by ALT-TAB :mad:
Posted on 2003-05-09 18:07:03 by Hiroshimator

What adds to this is that code to do this is somehow uncertain and i have seen many games (surely including HE) that ***sometimes*** crash or let screen in dummy resolutions or colors at alt TAB... this is another reason as no producer wants to release a game that *** sometimes *** crashes --even if rarely ...
This happens plenty even on commercial games I've purchased. I'm assuming that they don't follow the guidelines in the DX documentation - which states the game isn't guaranteed anything in the way of exclusion (atleast this is the case with DX8+).
Posted on 2003-05-09 18:44:48 by bitRAKE
I've seen some high performance games handle ALT-TABing rather nicely with no reloading. I wish I could remember which it was. It even faded the sound out.
Posted on 2003-05-09 19:11:50 by iblis
Imo, there's no excuse not to handle application switching properly if you're doing a game. It's sloppy coding, it's assuming that you can monopolize the PC like a console, and saying that users shouldn't be allowed to tab out to check bus plans is bad know-better attitude.

Dungeon Siege handles tabbing gracefully, fading music in/out.
Battlefield 1942 handles it gracefully.
A lot of games handle it gracefully. Kudos to their developers.

Yes, tabbing out+back can take a lot of time and be a major penalty (yadda yadda), but the user will (or should) be prepared for this if he tabs. And since you can lose surfaces and resources at any time, you might as well be prepared to handle it without taking a too big speed hit.
Posted on 2003-05-10 02:49:27 by f0dder
I agree f0dder,

Indeed i plan to do the same for HE.

However there is NO WAY to avoid a big Alt_Tab penalty esp on games that have many big textures. The only way i can see this done is to keep alltextures in system memory also (while they are in video memory also). But this will somehow drain big ammounts of RAM from PC and from the game itself... :(

Restoring video textures from system memory located textures should be much faster than reloading them from HDD, and eventually decode them.

Besides i am moving this thread to Games as it becomes more and more related to this
Posted on 2003-05-10 05:04:30 by BogdanOntanu
Yes, there will be a hit - and it can be big.
I propose that instead of keeping both memory and on-gpu copies of everything, you design a cache system. Never use direct file I/O (ReadFile, whatever) anywhere - use calls to your own designed FS system. That system can the be designed to do caching of various forms (and this can be done more optimal than OS caching, since you will know the access patterns better - you can even do logging in your FS system, so you can see the access patterns, and groups files for less seeking around).

Using your own FS layer has lots of advantages. Pre-caching, being able to store your files in whatever form you desire (memory, one-big-pack, compressed, encrypted, whatever). Tweakable cache size - you name it.
Posted on 2003-05-10 05:11:13 by f0dder
They disable ALT-TAB so that users won't tab out and start a 3rd party program which enables them to cheat.
Posted on 2003-05-10 05:47:43 by Zynaps
Thnakyou all for helping me out:grin:
Posted on 2003-05-11 00:08:05 by telophase