When a Non-Modal Window is Closed which Even Is fired
-
Dear All I want to Add some code when a Non Modal Windows is closed. Which Event is Fired when such a situation is occured. I test following Items and dont get answer: 1. OnDestroy 2. OnClose Best Regards Mahdi
-
Dear All I want to Add some code when a Non Modal Windows is closed. Which Event is Fired when such a situation is occured. I test following Items and dont get answer: 1. OnDestroy 2. OnClose Best Regards Mahdi
Are you sure OnClose is not called? Are you not using OnCancel to close the dialog?
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
Dear All I want to Add some code when a Non Modal Windows is closed. Which Event is Fired when such a situation is occured. I test following Items and dont get answer: 1. OnDestroy 2. OnClose Best Regards Mahdi
Are you sure
OnDestroy
isn't called? How do you 'close' the window? :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Are you sure
OnDestroy
isn't called? How do you 'close' the window? :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]I find the answer by trial and error PostNcDestroy is called when a non modal page is closed. Thank you for your help.
-
I find the answer by trial and error PostNcDestroy is called when a non modal page is closed. Thank you for your help.
The
CWnd::OnDestroy()
should be called as per documentation. Extract from MSDN : "This method is called by the framework to inform the CWnd object that it is being destroyed. OnDestroy is called after the CWnd object is removed from the screen." I guess, something went wrong when you add your message handler forWM_DESTROY
. Try once again by addingWM_DESTROY message handler
by using class wizard. Regards, Jijo._____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.
-
Dear All I want to Add some code when a Non Modal Windows is closed. Which Event is Fired when such a situation is occured. I test following Items and dont get answer: 1. OnDestroy 2. OnClose Best Regards Mahdi
Gut Mikh Tappe wrote:
I test following Items and dont get answer
Did you add entries to the window class' message map so those methods would actually get called? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: