Removing close button in a CDialogBar

Hi,
VC++ 6.0 SP3, NT4.0 SP5
I have a CDialogBar with a CPropertSheet with two PropertyPages in it. The dialogBar is dockable. What I need to do is remove the small 'x' button <close> in the upper right corner of the bar. I've tried the code from CodeGuru on removing the sysmenu from a toolbar, but nothing seems to work. I'm not even sure if this is an actual sysmenu, the close button is a lot smaller than a normal close button.
IF someone has a clue how to do this, please help!

Thanks
newton1
newton1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

VCGuruCommented:
What I did is this,
a) I Created my own dialogbar(CMyBar) class using class wizard(Derive it out og generic CWnd and then replace CWnd with CDialogBar)

b) Handled Left mouse button double click in this class.

c) Override Create
d) Go to the mainframe class and change the declaration of the CDialogBar object to CMyBar.

mainfrm.h
#include "Mybar.h"
class CMainFrame:....
{
CMyBar m_wndDialogbar;
}

Mybar.cpp

BOOL CMyBar::Create( CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID )
{
      BOOL bReturn = CDialogBar::Create(pParentWnd,nIDTemplate,nStyle,nID);
      return bReturn;
}


void CMyBar::OnLButtonDblClk(UINT nFlags, CPoint point)
{
      // TODO: Add your message handler code here and/or call default
      
      CDialogBar::OnLButtonDblClk(nFlags, point);
      if(IsFloating())
      {
            CWnd* pMiniFrame;            
            CWnd* pDockBar;
            pDockBar = GetParent();            
            pMiniFrame = pDockBar->GetParent();
            //get rid of window menu            
            pMiniFrame->ModifyStyle(WS_SYSMENU, NULL);
            pMiniFrame->ShowWindow(SW_HIDE);
            pMiniFrame->ShowWindow(SW_SHOW);      
      }
      

}

That's it it starts working
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
V_BapatCommented:
When your DialogBar is floating, its parent is a special frame with a mini title bar and a close button.

This frame is dynamically created by the framework using the value of the
'm_pFloatingFrameClass' pointer.

I would suggest you to modify the behaviour of this special frame and NOT your DialogBar.
0
newton1Author Commented:
Thanks a lot vcGuru!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.