Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

LazWin32CustomAppStyle

Simple StyleManager for Win32/64 created with Lazarus

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

https://www.hiperapps.com

SGJ LazWin32CustomAppStyle

What's this?

Simple Style manager for Win32/64 apps created on Lazarus.

How it works?

It's replace original window theme. It's replace original window theme. Controls Parts and States is painted by custom theming.

It's usefull for create custom Dark Mode or another theme for app.

Requirements

Compatibility

  • Windows 11
  • Windows 10
  • Windows 8.x
  • Windows 7
  • Windows Vista
  • Windows XP / Server 2003

[!WARNING] It works now, but there is no guarantee it will work in the future.

How to use?

Add DDetours and this src for unit path. Open Your project *.LPR file. Add to uses SGJ.Win32Styles, and your custom theme(example: sgj.win32styles.themes.dark).

Add after Application.Initialize; and before Application.CreateForm(...) :

pascal
  SGJ.Win32Styles.Themes.Dark.CS_SetCustomColors;
  SGJ.Win32Styles.InstallCustomStyle;

Change theme at runtime

pascal
SGJ.Win32Styles.Themes.Dark.CS_SetCustomColors; // example theme
PostMessage(self.Handle, WM_CS_THEMECHANGE, 0, 0);  // form handle, WM_CS_THEMECHANGE is declared in SGJ.Win32Styles

Load default OS Theme

pascal
SGJ.Win32Styles.Themes.CS_Enable:=false;
PostMessage(self.Handle, WM_CS_THEMECHANGE, 0, 0);

Donate

If you appreciate this project, you can support my work:

https://suppi.pl/sgj