SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTree/NET 2.0 - Tree Control
Apply dark mode to a top-level window's non-client area. Sets the dark title bar through DWM and forces the system to recompute the NC area so the title bar repaints in the new color.
C
void SftDarkMode_ApplyToWindow(HWND hwnd);
hwnd
The top-level window to apply dark mode to.
ApplyToWindow handles the window aspect of dark mode - title bar color, frame, and the dark-mode opt-in. It does not touch the window's children. Use SftDarkMode_ApplyToDialog for the typical dialog scenario where the dialog and every child should be themed in one call.
The helper sets the DWMWA_USE_IMMERSIVE_DARK_MODE attribute through DwmSetWindowAttribute (using both attribute index 19 and 20 to cover Windows 10 1809-1903 builds), calls AllowDarkModeForWindow on the window, and forces an NC redraw via SetWindowPos(... | SWP_FRAMECHANGED).
On Windows builds that do not support the immersive dark mode attribute, DwmSetWindowAttribute returns an error which is ignored - ApplyToWindow has no visible effect on those platforms.
See Also ApplyToDialog | ApplyToControl | ApplyToChildren
