I have a project created with VC2010 and the initial layout is almost ideal, it has a CFileView and a CClasView in a tabbed bar on the left and a CPropertiesWnd on the right.

But for my project these windows need to say where they are and not be moveable, I want to fix them in place. But I can't find out where/how to do that. If I right click in these windows I get the menu for docking, autohide etc. I'd like to disable these options, but how?

I preferably like to actually disable them, but if I can just disable the menu that might be useful alternative.

Check if any of the windows are derived from CDocablePane.

I've check and they are all derived from CDockableView, but I still don't know how to stop them being dragged and enabled/disabled by the user.

Are you sure it's called CDocableView?? I'm looking at the MFC Hierachy Chart and don't see such a vew.

Actually it is CDockablePane, a small missprint.

Thanks Ancient Dragon, with your nudge to me in the right direction, and digging into CDockablePane I've found I should override various functions like:

virtual BOOL CanFloat() const { return FALSE ; }
virtual BOOL CanBeClosed() const { return FALSE ; }
virtual BOOL CanAutoHide() const { return FALSE ; }

to get the behaviour I want. Almost there!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.