How to define a system theme to be applied that matches the new style and apply it. Please find the attached image for the actual and expected style.
MDI Frame window color:
The following approaches i have tried so far, it was not yielded expected result.
1: Setting Application caption using Windows API The following code sets the color for application title bar for the session. But with theme settings and such on Windows 8.1 and 10, it does not come into effect.
int aElement = COLOR_ACTIVECAPTION;
DWORD aOldColor;
DWORD aNewColor;
aOldColor = GetSysColor(aElement);
aNewColor = RGB(0x04, 0x04, 0x04);
SetSysColors(1, &aElement, &aNewColor);
2: Using theme/DWM API
With a Windows theme in effect, changing the application title bar alone does not become successful. Have tried:
2-a: Getting theme handle, defining a captionbar and using the captionbar in a call to CMFCVisualManager::GetInstance()->OnDrawCaptionBarBorder()
2-b: DwmSetWindowAttribute()
was used for setting rendering policy disabled.
3: Using CMFCVisualManager
Defining a CMFCCaptionBar
and assigning it to CMFCVisualManager
. This too does not get the effect needed.