Archived

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

BoRReL

DX +ALT F4

Recommended Posts

Heya, how can I disable ALT-F4 in a fullscreen, exclusive DX application??? Thanks in advance! Gr, BoRReL

Share this post


Link to post
Share on other sites
The only way I have found to disable alt-f4 and all the other annoying keys is by runnning Direct input in exclusive mode

this also gets ride of things like the windows key alt tab and alt enter forcing you to program all this yourself and post messages and stuff like that.

Share this post


Link to post
Share on other sites
Diabling any common windows functionality will just show your users how badly you design and code.

Take Everquest, that POS. You can''t get out of the game without quitting, which involves camping for 30s and hitting esc on multiple screens to finally free yourself of such a poorly designed piece of software.

G''luck,
-Alamar

Share this post


Link to post
Share on other sites
Everquest is like that to deter people from alt-tabbing and surfing, chatting, and having fun while they are medding/resting, etc. Its also to deter people from using 3rd party software to gain advantages (automap, etc).

In the end it doesnt really do much, as its easy to do any of those things on a second computer, but they try. I dont find it that bad because of the nature of everquest. You really arent suppose to be able to get into the world real quick and leave within 3 key presses....

just my 2c

ratman

---------------
Ratfest.org

Share this post


Link to post
Share on other sites
Heya,

thanks!
Ok, so if I want to make my program respond to windows properly,
how do I handle the Alt-F4 then?
Now pressing the Escape key will Post A Quit message to the messagepump. (PostQuitMessage(0)
The messageloop stops and finally my cleanup procedure is called.

But when Alt-F4 is pressed, the program just stops and does not perform the cleanup.

Must I overload the windows exit() function to check if everything is cleaned, or is there a better solution?

Gr,
BoRReL

Share this post


Link to post
Share on other sites
Pressing Alt+F4 posts a WM_DESTROY message to your window, so you must handle the WM_DESTROY message like this in your WndProc...
    
case WM_DESTROY:
PostQuitMessage(0);
break;

In our PC games, if the user cannot press Alt+F4 to quit at any time or if the user cannot Alt+Tab to switch to another task, then that is considered a bug in the software and gets logged in the bug-tracking database. Disabling Alt+F4 or disabling task switching via Alt+Tab is A Very Bad Thing(tm) in my opinion.

Edited by - Sly on June 27, 2001 6:46:23 PM

Share this post


Link to post
Share on other sites
Thanks!!

Strange thing is, I already had that piece of code, but still does ALT-F4 crash my program.

Any Ideas??

Gr,
BoRReL

Share this post


Link to post
Share on other sites
register your window as a screensaver..

i cant remember how , but i know as a screensaver, your window cannot be closed by ALT-F4 or even CTRL-ALT-DEL



{ Stating the obvious never helped any situation !! }

Share this post


Link to post
Share on other sites
Does your shutdown code attempt to destroy the window? Alt-F4 destroys your window for you. Trying to destroy it again might cause problems.

if(IsWindow(hWnd)) DestroyWindow(hWnd);

Share this post


Link to post
Share on other sites
From the SDK docs:
The PostQuitMessage function posts a WM_QUIT message to the thread''s message queue and returns immediately; the function simply indicates to the system that the thread is requesting to quit at some time in the future.

When the thread retrieves the WM_QUIT message from its message queue, it should exit its message loop and return control to the system. The exit value returned to the system must be the wParam parameter of the WM_QUIT message.


So you can also handle the WM_QUIT message, which should let you do ''final'' processing before the application quits completely. There STILL is processing done after using PostQuitMessage(0);




MatrixCubed
http://MatrixCubed.org






Share this post


Link to post
Share on other sites