Reputation: 1
Im using DestroyWindow(HWND), but when I need to open again the same window, doesnt execute. I already try with CloseWindow(HWND), but just minimizes de window. This is what i have in the command Destroy
case WM_DESTROY: {
DestroyWindow(contacts);
break;
}
Upvotes: 0
Views: 408
Reputation: 11148
First, your code is invalid. WM_DESTROY is sent to the window after you (or someone else) have already called DestroyWindow().
You want to call this function in response to WM_CLOSE instead. This destroys the window permanently.
Second, there is no reopening. Either hide/show (ShowWindow) or recreate. Most probably all you need is ShowWindow with SW_HIDE/SW_SHOWNORMAL.
Upvotes: 2