• Advertisement

Archived

This topic is now archived and is closed to further replies.

Alt+Tab

This topic is 5497 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im sure this has been asked before, but for my console game, it opens up full screen.. And was just wondering how I can lock the Alt+Tab?? or alt+f4..if thats possible. thanks, Inpho

Share this post


Link to post
Share on other sites
Advertisement
I know how to do it in a win32 application, but not in a win32 console project sorry.

I am not sure that you can do that in a console, because you need to be able to intercept the WM_CLOSE message for alt + f4 and for alt+tab you need to intercept a few(WM_ACTIVATE I think and another).

Later,


Michael Bartman

Share this post


Link to post
Share on other sites
You can''t intercept Alt+Tab in a console application.

However, you can intercept Alt-F4 using SetConsoleCtrlHandler(). You set up a handler that looks for CTRL_CLOSE_EVENT events and returns TRUE when found. That causes a pop-up that asks the user if they want to terminate or not.

Unfortunately, there''s no way to avoid the pop-up...

Share this post


Link to post
Share on other sites
Why do you want to make your app more annoying for the user? I sometimes find that when playing a game, I want to stop (or start) Winamp or ICQ. Should I have to quit the game first?


Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions

Share this post


Link to post
Share on other sites
Diableing the Alt+Tab key is sometimes necessary to ensure the security of the application. Take a MMORPG, by letting the user Alt+Tab you allow the user to stop his client, while the world continues. This causes a sync problem. It also allows a user to run a false app that send commands directly to the server and in some instances cheat. I''m not saying that disiabling the Alt+Tab key is a good solution for this, as I have hated not being able to drop out of a game to reply to am message or mess with winamp, I am mearly giving an example of it''s use.

BW

Share this post


Link to post
Share on other sites
The solution to this problem (MMORPG) is simply to freeze the application and have the message sent that the application is doing so. This to avoid cheating. This is really up to the designer of course. Yes, you can argue about icq popping up etc... but as a developer you can have it as a requirement that these things should be turned off. I know plenty cases where people have msn running planning things together (cheating) in all kinds of games so this is a real problem that should be adressed. In my own API the freeze is built in(currently), so what if it is an annoyance, that is nothing compared to how those who have cheating players against them feel. I am actually going to build in functions that can see if you have these things running and give the opportunity to quit the application. (Of course this should be a developers choice but this is how I feel about it) Actually I would like to hear about how others feel about this any any ideas/suggestions you might have. But please do that at my own forum at www.planetrift.com. As for the ALT-TAB issue you can avoid it by changing the values in the registry but this is highly adviced against since on an NT/XP machine this can cause the problem of not being able to log on to a machine again. The ALT-TAB is a safeguard to shut down buggy applications if possible.

____________________________________________________________
Try RealityRift at www.planetrift.com
Feel free to comment, object, laugh at or agree to this. I won't engage in flaming because of what I have said.
I could be wrong or right but the ideas are mine.




[edited by - MichaelT on February 7, 2003 3:37:21 PM]

Share this post


Link to post
Share on other sites

  • Advertisement