I have a legacy Visual Studio 6.0 application. I need to change the color of the Dockbar (as illustrated in the attached picture). I have tried the implementation found here to no effect.
I'm not having much luck in my internet search endeavors.
Basically, can't I grab a dockbar (top, bottom, left, etc...) at paint (or in CMainFrame::OnNotify) time like: (where m_BrushDocBar is my initialized brush of my preferred color.)??
I'd really appreciate any pointers on how to accomplish this. Thanks.Code:CControlBar* pTopDockBar = GetControlBar(AFX_IDW_DOCKBAR_TOP); if (pTopDockBar != NULL) { SetClassLong(pTopDockBar->m_hWnd, GCL_HBRBACKGROUND, (LONG)m_BrushDocBar.GetSafeHandle()); }
Edit: I tried the code below in CMainFrame::OnCreate. No effect
DockBarColor.pngCode:CControlBar* pTopDockBar = GetControlBar(AFX_IDW_DOCKBAR_TOP); HWND hBar = pTopDockBar->GetSafeHwnd(); ::SetClassLongPtr( hBar, GCLP_HBRBACKGROUND, (LONG_PTR)GetSysColorBrush(COLOR_ACTIVECAPTION));




Reply With Quote
