Yeah that project is where I got the 2nd call from... that's what it's doing in RefreshTitleBarThemeColor. You could try that SetProp call too...
It looks like you also need to set the theme to Explorer with SetWindowTheme...Code:Public Declare Function SetPropW Lib "user32" (ByVal hWnd As Long, ByVal lpString As Long, Optional ByVal hData As Long) As BOOL Dim bValue As Long: bValue = 1 SetPropW hWnd, StrPtr("UseImmersiveDarkModeColors"), VarPtr(bValue)
Public Declare Function SetWindowTheme Lib "uxtheme" (ByVal hwnd As Long, ByVal pszSubAppName As Long, ByVal pszSubIdList As Long) As Long
SetWindowTheme hWnd, StrPtr("Explorer"), StrPtr("")
And this thread suggests DWMWA_USE_IMMERSIVE_DARK_MODE should be 19 if your Windows 10 version is earlier than 20H1.
Here's the complete enum, sorry I forgot to include it:
As to the entry point, that's weird... it's a documented function Microsoft says appears both in both uxtheme and dwmapi.Code:Public Enum WINDOWCOMPOSITIONATTRIB WCA_UNDEFINED=0 WCA_NCRENDERING_ENABLED=1 WCA_NCRENDERING_POLICY=2 WCA_TRANSITIONS_FORCEDISABLED=3 WCA_ALLOW_NCPAINT=4 WCA_CAPTION_BUTTON_BOUNDS=5 WCA_NONCLIENT_RTL_LAYOUT=6 WCA_FORCE_ICONIC_REPRESENTATION=7 WCA_EXTENDED_FRAME_BOUNDS=8 WCA_HAS_ICONIC_BITMAP=9 WCA_THEME_ATTRIBUTES=10 WCA_NCRENDERING_EXILED=11 WCA_NCADORNMENTINFO=12 WCA_EXCLUDED_FROM_LIVEPREVIEW=13 WCA_VIDEO_OVERLAY_ACTIVE=14 WCA_FORCE_ACTIVEWINDOW_APPEARANCE=15 WCA_DISALLOW_PEEK=16 WCA_CLOAK=17 WCA_CLOAKED=18 WCA_ACCENT_POLICY=19 WCA_FREEZE_REPRESENTATION=20 WCA_EVER_UNCLOAKED=21 WCA_VISUAL_OWNER=22 WCA_HOLOGRAPHIC=23 WCA_EXCLUDED_FROM_DDA=24 WCA_PASSIVEUPDATEMODE=25 WCA_USEDARKMODECOLORS=26 WCA_CORNER_STYLE=27 WCA_PART_COLOR=28 WCA_DISABLE_MOVESIZE_FEEDBACK=29 WCA_LAST=30 End Enum




Reply With Quote
