Sunday, July 12, 2009

Do I need to use DeleteObject() and DestroyWindow() before I call PostQuitMessage (0);???

I'm using the windows api in c++. If I do need to use DeleteObject() and DestroyWindow() before I call PostQuitMessage() why???

Do I need to use DeleteObject() and DestroyWindow() before I call PostQuitMessage (0);???
You do not. What DestroyWindow does is send a WM_DESTROY message to your program. Your program should already handle the WM_DESTROY message with a PostQuitMessage(). WM_DESTROY is sent when a person hits the X button on the top corner. Even if you use a custom button to exit, you only need to use PostQuitMessage


No comments:

Post a Comment