Hey guys,

I've just started using a program called MemProof which keeps track of handles throughout your programs life, then when you close your app, gives you advice on what resources you should free.

I just tested it on my program and was wondering, I've processed the WM_CLOSE to clear up some of the resources and once thats done I send my app the WM_DESTROY.


MSDN says that WM_DESTROY destroys all child windows of the parent window if the parent window gets destroyed (which is what I'm doing) - but MemProof doesn't show me that this is a actually happening it only indicates that the main window has been successfully destroyed.

Is it really a problem if these child windows (like statics, rebars, toolbars, etc.) aren't destroyed? And how about icon handles such as the one you place in the titlebar, because memproof still shows that it was never destroyed/freed aswell?

Thanks, Any pointers and ideas would be greatly appreciated,

PS. I'd post some of my source and a screen cap of MemProof but I don't have access to my desktop PC at the moment... sorry
Posted on 2002-05-06 23:30:14 by JamesE
I'm afraid sending WM_DESTROY does not destroy windows. Calling DestroyWindow does that. DestroyWindow will do a recursive destroy, destroying child windows and their children. It will send a WM_DESTROY before destroying (but after removing the window from the video screen), so that you still have a valid window handle for releasing objects that aren't automatically released by DestroyWindow.
Posted on 2002-05-07 02:46:56 by tenkey
Imo, you ought to do resource cleanup in WM_DESTROY, not WM_CLOSE.
Posted on 2002-05-07 04:21:08 by f0dder