I’m updating an old WIN32 app to support dark mode. After creating the window I do the following:
DWMNCRENDERINGPOLICY ncrp = DWMNCRP_ENABLED;
DwmSetWindowAttribute(hwnd, DWMWA_NCRENDERING_POLICY, &ncrp, sizeof(ncrp));
BOOL value = TRUE;
DwmSetWindowAttribute(hwnd, DWMWA_USE_IMMERSIVE_DARK_MODE, &value, sizeof(value));
I now have a window frame and title bar that draw in the correct color (following the system dark mode setting). However, the menu bar is still drawn in a light color.
All menus are created programatically, not using a resource file. There’s no custom drawing happening. Is there a way to get the menu bar to draw correctly without having to custom draw it?