tags:

views:

41

answers:

1

I have created a window which has a toolbar with some icons, and I launch one more window clicking on the available icon from the main window.

First window is created using CreateWindowEx method. the one I click using an icon is created using dialog resource. So without closing dialog, I directly close the main window. I see that dialog window is not getting closed. When I debug, control does not come to destructor of second window.

When I close them individually (i.e dialog first) and then main window next,then everything is fine.

Please help,that what might be missing when I close the main window.

I mean class desctructor is not getting called.

+2  A: 

Handle your main window's message WM_CLOSE and check, whether the dialog window is open or not. If dialog window is open, just close it using the handle you got returned while loading it from resources.

AOI Karasu