Fix check reg AppsUseLightTheme

This commit is contained in:
alinvip22@gmail.com
2023-04-21 22:04:39 +05:00
parent ef99080c43
commit 0c887a8980
+3 -2
View File
@@ -122,11 +122,12 @@ function IsDarkMode: Boolean;
var
LRegistry: TRegistry;
begin
Result := False;
LRegistry := TRegistry.Create;
try
LRegistry.RootKey := HKEY_CURRENT_USER;
LRegistry.OpenKeyReadOnly('\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize');
Result := not LRegistry.ReadBool('AppsUseLightTheme');
if LRegistry.OpenKeyReadOnly('\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize') then
Result := not LRegistry.ReadBool('AppsUseLightTheme');
finally
LRegistry.Free;
end;