If I remember correctly what is happening is that MFC is drawing the text in the window caption for a maximized window using white. Windows 10 uses white for the caption bar. So white text on a white background is not visible.
One way to solve the problem is to change the way that MFC draws the caption text for the maximized window. One way to do this when using the MFC Ribbon and the related CMFCVisualManager derived classes is to roll your own and override a virtual method.
For example -
MyVisualManagerOffice2007.h -
#pragma once
// CMyVisualManagerOffice2007 command target
class CMyVisualManagerOffice2007 : public CMFCVisualManagerOffice2007
{
DECLARE_DYNCREATE(CMyVisualManagerOffice2007);
public:
CMyVisualManagerOffice2007();
virtual ~CMyVisualManagerOffice2007();
BOOL DrawTextOnGlass(
CDC* pDC,
CString strText,
CRect rect,
DWORD dwFlags,
int nGlowSize = 0,
COLORREF clrText = (COLORREF)-1) override;
};
MyVisualManagerOffice2007.cpp -
// MyVisualManagerOffice2007.cpp : implementation file
//
#include "stdafx.h"
#include "MyVisualManagerOffice2007.h"
// CMyVisualManagerOffice2007
IMPLEMENT_DYNCREATE(CMyVisualManagerOffice2007, CMFCVisualManagerOffice2007);
CMyVisualManagerOffice2007::CMyVisualManagerOffice2007()
{
}
CMyVisualManagerOffice2007::~CMyVisualManagerOffice2007()
{
}
BOOL CMyVisualManagerOffice2007::DrawTextOnGlass(CDC * pDC, CString strText, CRect rect, DWORD dwFlags, int nGlowSize, COLORREF clrText)
{
COLORREF clr = clrText != RGB(255, 255, 255) ? clrText : RGB(255, 0, 0);
return CMFCVisualManagerOffice2007::DrawTextOnGlass( pDC, strText, rect, dwFlags, nGlowSize, clr);
}
Edit MainFrame.cpp OnApplicationLook function to use the CMyVisualManagerOffice2007 class -
switch (theApp.m_nAppLook)
{
case ID_VIEW_APPLOOK_OFF_2007_BLUE:
CMyVisualManagerOffice2007::SetStyle(CMyVisualManagerOffice2007::Office2007_LunaBlue);
break;
case ID_VIEW_APPLOOK_OFF_2007_BLACK:
CMyVisualManagerOffice2007::SetStyle(CMyVisualManagerOffice2007::Office2007_ObsidianBlack);
break;
case ID_VIEW_APPLOOK_OFF_2007_SILVER:
CMyVisualManagerOffice2007::SetStyle(CMyVisualManagerOffice2007::Office2007_Silver);
break;
case ID_VIEW_APPLOOK_OFF_2007_AQUA:
CMyVisualManagerOffice2007::SetStyle(CMyVisualManagerOffice2007::Office2007_Aqua);
break;
}
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMyVisualManagerOffice2007));
Above changes will cause the caption text to be drawn in red when the window is maximized.
Not maximized -
maximized -