Skip to main content
gamedev.net
🔒 Locked

exit

Started by Da cobra Apr 21, 2004 at 2:01 PM 2 replies 650+ views
Original Post
Da cobra
Da cobra
What''s the code to exit your program? I thought it was PostQuitMessage(0)? because when by example I press the text "exit" in my menu I do a PostQuitMessage(0) and then in my message handler under the case WM_DESTROY I do all my DX cleanup, but it doesn''t clean my DX up? I know this because I just implented my logging system. When I press alt-F4 or the X of the window then it does all the DX cleanup.
Pipo DeClown
Pipo DeClown
case WM_DESTROY:
PostQuitMessage(0);
break;

case WM_CLOSE:
DoYourThang();
DestroyWindow(hwnd);
break;

--
You''re Welcome,
Rick Wong

- sitting in his chair doing the most time-consuming thing..
Oluseyi
Oluseyi
Have your exit menu item send a WM_CLOSE message.
zoggo
zoggo
Just a though: PostQuitMessage only sends the WM_QUIT message. You should probably call DestroyWindow at some point if you want to clean up DX there.

Topic Locked

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

Sign in to reply to this topic.