Skip to content

Commit

Permalink
fix: dark title bars now work on Simba64 bits
Browse files Browse the repository at this point in the history
  • Loading branch information
Torwent committed Jul 25, 2024
1 parent 5522a84 commit 35d3179
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions utils/forms/formutils.simba
Original file line number Diff line number Diff line change
Expand Up @@ -1756,15 +1756,12 @@ external 'ShowWindow@user32.dll ' + WINAPI_CC;
function SetWindowAttribute(hwnd: TOSWindow; dwAttribute: DWORD; pvAttribute: Pointer; cbAttribute: DWORD): UInt32;
external 'DwmSetWindowAttribute@dwmapi.dll ' + WINAPI_CC;

function SetWindowAttribute(hwnd: TOSWindow; dwAttribute: DWORD; pvAttribute: LongBool): UInt32; overload;
begin
Result := SetWindowAttribute(hwnd, dwAttribute, @pvAttribute, SizeOf(pvAttribute));
end;

function SetWindowDarkTitleBar(hwnd: TOSWindow): UInt32;
const WINDOWS_DARK_MODE_ATTRIBUTE = 20;
const
DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
DARK: LongBool = True;
begin
Result := SetWindowAttribute(hwnd, WINDOWS_DARK_MODE_ATTRIBUTE, True);
Result := SetWindowAttribute(hwnd, DWMWA_USE_IMMERSIVE_DARK_MODE, @DARK, SizeOf(DARK));
end;


Expand Down

0 comments on commit 35d3179

Please sign in to comment.