From 9aecfe373d757fc389065c8bc6c269daafef21f9 Mon Sep 17 00:00:00 2001 From: anders_k Date: Thu, 8 Jul 2021 18:23:28 +0000 Subject: [PATCH] Chasing the dark mode dragon git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7276 212acab6-be3b-0410-9dea-997c60f758d6 --- Examples/NSISMenu.nsi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Examples/NSISMenu.nsi b/Examples/NSISMenu.nsi index ccf11f08..d1d291f8 100644 --- a/Examples/NSISMenu.nsi +++ b/Examples/NSISMenu.nsi @@ -77,8 +77,11 @@ ReadRegDWORD $UseLightTheme HKCU "Software\Microsoft\Windows\CurrentVersion\Them StrCmp $UseLightTheme "" 0 +2 StrCpy $UseLightTheme 1 ; Default -StrCmp $UseLightTheme "0" 0 +2 -System::Call 'USER32::SetProp(p$hWndParent,t"UseImmersiveDarkModeColors",i1)' +StrCmp $UseLightTheme "0" 0 +5 +System::Call 'DWMAPI::DwmSetWindowAttribute(p$hWndParent,i20,*i1,i4)i.r0' ; 20H1 +IntCmp $0 0 +3 +3 +System::Call 'DWMAPI::DwmSetWindowAttribute(p$hWndParent,i19,*i1,i4)i.r0' ; ; 19H1 +System::Call 'USER32::SetProp(p$hWndParent,t"UseImmersiveDarkModeColors",i1)' ; 1809 FunctionEnd !define SetCtlColors "!insertmacro SetCtlColors "