i m having the problem in subclassing.. I want to capture WM_CLOSE message and want to do something other than just closing.. then i want to close the form as well. ... everything goes right..other than when i try to close the form.. i don't want it's default proc to handle this message so i skip calling it.. but when i use SendMessage to close my form.. it's closing my whole application... and if i use DestroyWindow then it's not returning resources to the system... so form is out but resources are still there...
Do u have any idea?
Anyways, 2nd option: Try sending additional data in your wParam or lParam. Test for it in your subclassing procedure and skip the message processing if necessary.
Let me tell u the actual situation....
I have a control which shows a dialog box when i close the form containing that control... (it does so only in exe) i want to override this behavior my hooking the default window procedure...and process WM_CLOSE message myself..
the problem is that.. whenever i used any method to close the form that messes up the things..
If I use sendmessage to send WM_CLOSE Event. that closes the whole application with an illegal operation message, when i use DestroyWindow it doesn't unload the form..and another thing that form doesn't get loaded again..once i've used DestroyWindow to close the form...
I think now the things are clear