Ok, as far as I know, cleanup is mostly done in this order:
1) WM_CLOSE calls DestroyWindow()
2) WM_DESTROY calls PostQuitMessage()
3) Loop ends on WM_QUIT, and application returns
But is there any problem if it's done in this order:
1) WM_CLOSE calls PostQuitMessage()
2) Loop ends on WM_QUIT
3) DestroyWindow() is called after the loop
4) application returns
Will there be any problems with leftover messages or anything of the sort? And would there be problems with other arrangements similar to this?