Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!
Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.
Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!
I'm not a daily Windows user, and Lazarus (at the moment) does not follow the Windows settings when set to Darkmode. Understandably, I have some applications where Windows users would like to see DarkMode, but the widgetset (LCL) does not support this at the time.
After a lot of searching, I did find a way that at least looks like it is darkmode - keep in mind that its pretty close but not perfect. This most likely only works with Windows 10 (I believe it even requires certain Windows 10 updats) and Windows 11. Tested with Win32 and Win64 binaries.
These are the steps (files attached - extract in project directory) to make your application start (!) in darkmode under Windows, when Windows is set to darkmode.
Note that changing dark/light mode while the application is running, is not working at the moment (suggestions/input most welcome).
Source: udarkstyle.pas and uWin32WidgetSetDark.pas from metadarkstyle
To make it work fully, I've added this to my main forms "OnCreate" event - this fixes some minor details that for some reason are not done automatically:
procedure TForm1.FormCreate(Sender: TObject);
begin
...
if IsDarkModeAppearance then ApplyDarkStyle;
...
end;
The function "IsDarkModeAppearance" detects darkmode kind-a cross platform, this is the part needed for Windows:
function IsDarkModeAppearance:boolean;
const
KEYPATH = '\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize';
KEYNAME = 'AppsUseLightTheme';
var
LightKey: boolean;
Registry: TRegistry;
begin
Result := false;
Registry := TRegistry.Create;
try
Registry.RootKey := HKEY_CURRENT_USER;
if Registry.OpenKeyReadOnly(KEYPATH) then
begin
if Registry.ValueExists(KEYNAME) then
LightKey := Registry.ReadBool(KEYNAME)
else
LightKey := true;
end
else
LightKey := true;
Result := not LightKey
finally
Registry.Free;
end;
end;
Note: The modifications I made were done in "uDarkStyle.pas" (line 254):
// mod to make sure light mode works proper as well
// was: AppMode := TPreferredAppMode(pamDefault);
if ShouldAppsUseDarkMode then
AppMode := pamForceDark
else
AppMode := TPreferredAppMode(pamDefault);
What this does is make sure things work properly in light mode (pamDefault) and dark mode (pamForceDark). The latter makes sure the titlebar is dark as well.
Based on slightly modified excellent and extensive work by Alexander Koblov (Double Commander).
Thanks for the tip! In the example I'm already using a unit from metadarkstyle (udarkstyle.pas), which I probably should have mentioned (correcting the original post in a minute). Totally overlooked mentioning that. 😊
Leapfrog 3D printers Manufacturer of the great Creatr and Xeed 3D printers - Stunning customer service!!
XKPassword Super practical website for those who need to generate one or a list of passwords based on words (more secure).
WordPress WordPress is one of the best tools for Blogs and Content Management Systems.
Ubuntu Ubuntu is probably one of the most used Linux distro's out there. Very well supported and a great Linux distro
VLC - VideoLAN Media Player One of the most flexible media players around and available on multiple computer platforms. Handles pretty much any audio and video type available and plays DVD as well.
AlternativeTo Great resource when you're looking for alternatives for an application that you'd like to use, but might not be available on your platform or the application you have is just not doing it right.
Links Page These and more of our favorite links can be found on the Links Page.
New Downloads
RenameMyTVSeries-2.3.12-QT5-Linux-x64-static-ffmpeg.tar.xzDate: 2025-09-28 - Size: 78.3 MBRename My TV Series, for Linux (64 bit QT5), a tool to assist in renaming TV Show episode files. This bundle comews with rather large static builds of ffmpeg and ffprobe.
RenameMyTVSeries-2.3.12-QT5-Linux-x64-shared-ffmpeg.tar.xzDate: 2025-09-28 - Size: 1.9 MBRename My TV Series, for Linux (64 bit QT5), a tool to assist in renaming TV Show episode files. This bundle relies on ffmpeg and ffprobe shared libraries on your system.
RenameMyTVSeries-2.3.12-GTK-Linux-x64-shared-ffmpeg.tar.xzDate: 2025-09-28 - Size: 1.9 MBRename My TV Series, for Linux (64 bit GTK), a tool to assist in renaming TV Show episode files. This bundle relies on ffmpeg and ffprobe shared libraries on your system.
RenameMyTVSeries-2.3.12-GTK-Linux-x64-static-ffmpeg.tar.xzDate: 2025-09-28 - Size: 1.9 MBRename My TV Series, for Linux (64 bit GTK), a tool to assist in renaming TV Show episode files. This bundle comes with (large) static builds of ffmpeg and ffprobe.
RenameMyTVSeries-2.3.12-Windows-x64-setup.exeDate: 2025-09-28 - Size: 49.1 MBRename My TV Series, for Windows (Intel 64 bit), a tool to assist in renaming TV Show episode files. Static builds of ffmpeg and ffprobe are included.
RenameMyTVSeries-2.3.12-macOS-Universal.dmgDate: 2025-09-28 - Size: 99.9 MBRename My TV Series, for macOS (Universal binary for Apple Silicon ARM and Intel 64 bit), a tool to assist in renaming TV Show episode files. Static universal binary builds of ffmpeg and ffprobe are included.
Downloads Page Find these and more Downloads on the Downloads Page, where you will also find articles references, operating system requirements and categories.
Amazon Ads
Support us by doing your shopping at Amazon.com, either click the link, or click one of the links below …
You can also sponsor us through these Amazon offerings:
Please consider disabling your ad blocker for our website.We rely on these ads to be able to run our website.You can of course support us in other ways (see Support Us on the left).