When a non modal windows is closed ?
-
Dear All In a small project I instantiate a non modal window by following code snippet : sheet->Create (NULL,-1,0 ); sheet->ShowWindow(SW_SHOW ); Then I set a timer , which I want to monitor the "sheet" windows when closed. Thus I want to implement a monitoring mechanisem in timer routine in order to be aware of close time of sheet window. How Can I do this? Regards Mahdi
-
Dear All In a small project I instantiate a non modal window by following code snippet : sheet->Create (NULL,-1,0 ); sheet->ShowWindow(SW_SHOW ); Then I set a timer , which I want to monitor the "sheet" windows when closed. Thus I want to implement a monitoring mechanisem in timer routine in order to be aware of close time of sheet window. How Can I do this? Regards Mahdi
Hello, you can close the non-modal dialog by calling CWnd::DestroyWindow[^] function. Best regards, Mihai Moga
-
Dear All In a small project I instantiate a non modal window by following code snippet : sheet->Create (NULL,-1,0 ); sheet->ShowWindow(SW_SHOW ); Then I set a timer , which I want to monitor the "sheet" windows when closed. Thus I want to implement a monitoring mechanisem in timer routine in order to be aware of close time of sheet window. How Can I do this? Regards Mahdi
Gut Mikh Tappe wrote:
Then I set a timer , which I want to monitor the "sheet" windows when closed.
What I understood is that - you want to check whether the sheet window is closed from your timer routine? A few suggestions are below, 1) You could call
IsWindow()
by passing the handle of dialog. If the window specified by handle doesn't exist, the api will return failure. The first question that comes to mind will be - What happen if the handle will be resued by any other window created in between? Not a real concern. Read this[^]. 2) You could send aWM_NULL
message to the window. If the send function failed, then your window is RIP! 3) But the best method is - instead of polling, let the sheet window notify you when it closes. Handle theWM_DESTROY
message in your sheet dialog and send a message to your parent window. Did i explained too much details? :rolleyes: Regards, Jijo._____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.
-
Gut Mikh Tappe wrote:
Then I set a timer , which I want to monitor the "sheet" windows when closed.
What I understood is that - you want to check whether the sheet window is closed from your timer routine? A few suggestions are below, 1) You could call
IsWindow()
by passing the handle of dialog. If the window specified by handle doesn't exist, the api will return failure. The first question that comes to mind will be - What happen if the handle will be resued by any other window created in between? Not a real concern. Read this[^]. 2) You could send aWM_NULL
message to the window. If the send function failed, then your window is RIP! 3) But the best method is - instead of polling, let the sheet window notify you when it closes. Handle theWM_DESTROY
message in your sheet dialog and send a message to your parent window. Did i explained too much details? :rolleyes: Regards, Jijo._____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.
Thank you Your help is great I can overcome the problem. Thanx again
-
Dear All In a small project I instantiate a non modal window by following code snippet : sheet->Create (NULL,-1,0 ); sheet->ShowWindow(SW_SHOW ); Then I set a timer , which I want to monitor the "sheet" windows when closed. Thus I want to implement a monitoring mechanisem in timer routine in order to be aware of close time of sheet window. How Can I do this? Regards Mahdi
can you change little architecture of your program, why can't non-modal dialog box notify parent dialog box.. when it closed!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/xml>
-
Gut Mikh Tappe wrote:
Then I set a timer , which I want to monitor the "sheet" windows when closed.
What I understood is that - you want to check whether the sheet window is closed from your timer routine? A few suggestions are below, 1) You could call
IsWindow()
by passing the handle of dialog. If the window specified by handle doesn't exist, the api will return failure. The first question that comes to mind will be - What happen if the handle will be resued by any other window created in between? Not a real concern. Read this[^]. 2) You could send aWM_NULL
message to the window. If the send function failed, then your window is RIP! 3) But the best method is - instead of polling, let the sheet window notify you when it closes. Handle theWM_DESTROY
message in your sheet dialog and send a message to your parent window. Did i explained too much details? :rolleyes: Regards, Jijo._____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.
Jijo raj wrote:
http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.
Cool Site!!!!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/xml>