0

I have a CPaneDialog which uses a dialog resource to show two graphics. One graphic is left justified and the other right justified. I always want that pane to be at the top of the main window below the menu bar. I want it to always be there, and don't want the user to be able to move it or remove it.

Is there a style I can set upon creation of the CPaneDialog that will not place the "pin" or "close" buttons in the pane?

I'm also looking for alternate approaches. I've looked into just using a CWnd, but I'm unclear how to force the other dockable windows to be consider the height of the windows in their initial positioning.

Suggestions?

cigarman
  • 635
  • 6
  • 15

1 Answers1

3

You can override CDockablePane::OnBeforeFloat and return FALSE to stop the pane from being detached. To then remove the buttons just call the protected method CDockablePane::RemoveCaptionButtons.

snowdude
  • 3,854
  • 1
  • 18
  • 27
  • That did it, thanks. RemoveCaptureButtons appears to be undocumented, though? – cigarman Nov 13 '13 at 18:47
  • One more question. Is it possible to remove the title bar from a CPaneDialog? – cigarman Nov 13 '13 at 21:49
  • 1
    Yes, it is undocumented. I just used FileLocator Pro to search through the MFC source to find out where the buttons were being drawn. Doing the same thing with DrawCaption you can see that OnNcPaint only calls DrawCaption if GetCaptionHeight() is > 0. So try overriding GetCaptionHeight and return 0. – snowdude Nov 13 '13 at 22:37