Closing a view 
Author Message
 Closing a view

Send the close to the parent frame instead of the view itself :
    GetParent()->PostMessage(WM_CLOSE, 0, 0);
A side note : should be m_hWnd instead of (HWND)this.
- Doug S.


> In a MDI program. within a view (CFormView), I have a button --
> IDCANCEL -- that, when clicked, should tell the window to close.  I
> assumed the following would work within CMyFormView::OnCancel()
> function:

>         PostMessage(WM_CLOSE);

> But, that didn't work.  Additionally, I tried the global function
> ::PostMessage:

>         ::PostMessage(((HWND)this), WM_CLOSE, 0, 0);

> But that didn't do anything either.  Could anyone provide some
> pointers/tips/help?  Thanks greatly in advance.

> -Sean Laurent-

Sun, 03 Dec 2000 03:00:00 GMT  
 Closing a view



Sun, 10 Dec 2000 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Close all views without closing the Doc

2. preventing document from closing when close all views

3. Closing a View with Ctrl-F4

4. How to disable closing a view ?

5. Closing a View with a button

6. Closing last view changes menu

7. Closing a view

8. Problem Closing Child View.

9. How to close one view from another / MDI ?

10. Closing a view

11. Back to Fundamentals: Closing the View

12. Closing multiple views


Powered by phpBB® Forum Software