Original Post
When I see example WindowProc functions most of the time they handle different messages including these:
WM_QUIT
WM_DESTROY
WM_CLOSE
I was wondering, what are the differences between these 3, when do they occur and what should I do when they occur?
To give an example, say if WM_QUIT means you clicked on the cross that closes an application, you should probably destroy everything and free the allocated memory. But if WM_DESTROY would mean everything is destroyed, you would only do PostQuitMessage(0) right?
That brings me to another question, what are the last commands given to close an application? I always see PostQuitMessage(0) but what does it really do, when should I use it and are there other things I need to do? (like if I do this in the end of the WinApi function, should I still return 0 afterwards to lose the function?)
Thanks in advance for the feedback!