Click to See Complete Forum and Search --> : 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.
Marqy
May 5th, 1999, 12:09 PM
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
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.
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.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.