CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Docking bars

  1. #1
    Guest

    Docking bars

    If a cdialogbar class window is 'docked' then when you hit the close button on the control the mesage is routed as normal ie the app receievs the wm_close message (i've added my own handler for the close button). But when the bar is floating the app does not get the message. How can this be resolved?
    The problem is the that the floating bar has been reparented by CMiniDockFrameWnd and my app does not get the message as this handles it.


  2. #2
    Join Date
    May 1999
    Location
    UK
    Posts
    59

    Re: Docking bars

    Don't you get a WM_CLOSE in your CDialogBar? You could call AfxGetMainWnd()->PostMessage() to notify the frame window that your dialog bar has been destroyed. If you don't get WM_CLOSE, you could handle DestroyWindow instead.

    MJA

  3. #3
    Guest

    Re: Docking bars

    Thanks for the response.
    What I'm trying to do is display a dialog. If the user says 'OK' then close the bar and save any changes . If the user says 'Cancel' then leave it open. If the user says 'NO' then close without saving any changes.

    The problem is that the CMiniDockFrameWnd has its own OnClose() which is not a virtual. I think this is getting the WM_CLOSE message before me.


  4. #4
    Guest

    Re: Docking bars

    The answer is to derrive a class from CMiniDockFramWnd and then handle
    OnClose() yourself. When the bar floats it will be parented with your own derrived class and not the default. You can then handle the wm_close message .

    What you must do is assign the m_pFloatingFrameClass=MyDockingWindowClass in your overrriden CMDIFrameWnd class.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured