Skip to main content
GameDev.net gamedev.net
🔒 Locked

Prevent application from exiting

Started by Metzler Nov 29, 2003 at 2:15 PM 2 replies 600+ views
Original Post
Metzler
Metzler
Hey, If i click on the tiny little cross in the top section of my window, it should not exit the application. How can i do that ? I have searched the web and didnt find anything useful. I know, that WM_CLOSE is sent to the window, when i click on the "X", but it finishes anyway... THX for answers Wolf Fischer
tHiSiSbOb
tHiSiSbOb
Well, in your winproc function under the WM_CLOSE case you should have something like PostQuitMessage(0). This tell the prog to die. If you take this out, it should not close when u tell it to. I just tested it and it works.
----------------------------------------------------"Plant a tree. Remove a Bush" -A bumper sticker I saw.
Metzler
Metzler
No, there is nothing like that function.
Actually i am just receiving the WM_CLOSE message (and i am just showing a little message box, when the user clicks on the cross), i outcommented WM_QUIT and WM_DESTROYED.
The process keeps running, but the window is being destroyed.
Metzler
Metzler
Ok, fixed it... I forgot, that i call the DefWindowProc at the end of my callback function...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.