Reputation: 11
I know how to create child windows. But what if I want to create one window (for example to customise settings) and after destroying it - a second one (based on a HGE engine). If I could break message loop by WM_DESTROY I could create second window after this message loop. But as I know GetMessage returns 0 only in WM_QUIT message and I cannot send this message because it means: "Close the application" not "Close the window". So my question is: How can i break message loop when first window gets WM_DESTROY? Is that actually possible?
Upvotes: 0
Views: 97
Reputation: 612794
It's quite simple really, and you should not be attempting to break out of you message loop.
Upvotes: 2
Reputation: 667
Just use PostMessage.
#define WM_USER_CREATE_NEW_CHILD WM_USER + 1
void OnDestroy() // on destroy first child
{
PostMessage( parentWindow, WM_USER_CREATE_NEW_CHILD, 0, 0 );
Upvotes: 0