Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » How to disable menubar hiding? Collapse All
Subject Author Date
Suhai Gyorgy Sep 21, 2005 - 8:09 AM

Hi!


I’m trying to disable hiding my main menubar. My app is an SDI. I already removed the responsible command from my menu’s "View" submenu, and other things concerning this.


Now there’s only one way to hide the menubar: when in floating state, I still have the "X" button that would hide it. How could I remove that? I want my menubar to be dockable and "floatable", but I want it to be visible all the time.


As I know, that floating window is a miniframe-based one, so I’m guessing I should derive a class from that... Isn’t there an easier way? And if there isn’t, what part of the original class shall I change?


Thank you in advance!  Chris.

Technical Support Sep 21, 2005 - 8:23 AM

Just use a CExtMenuControlBar-derived class like this:

class CNoCloseMenuControlBar : public CExtMenuControlBar

{

public:

    virtual void OnNcAreaButtonsReinitialize()

    {

        INT nCountOfNcButtons = NcButtons_GetCount();

        if( nCountOfNcButtons > 0 )

            return;

    #if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)

        NcButtons_Add( new CExtBarNcAreaButtonAutoHide(this) );

    #endif

        NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );

    }

};


Suhai Gyorgy Sep 21, 2005 - 8:34 AM

Thank you for the fast reply!


Other problems awaiting here, but I guess I’ll start a new thread for them.