View Single Post
  #1  
Old 15-11-2023, 17:35
BLACKFIRE69's Avatar
BLACKFIRE69 BLACKFIRE69 is offline
Registered User
 
Join Date: Mar 2019
Location: In the Hell
Posts: 688
Thanks: 481
Thanked 2,547 Times in 561 Posts
BLACKFIRE69 is on a distinguished road
Talking Windows Fluent Effects Standalone API - InnoSetup / VCL / FXM

Windows Fluent Effects Standalone API

Code:
Module: FluentApi.dll
Version: v2.0.0.1
Author : BLACKFIRE69
FileSize: 34.5 KB
Support: Windows 7, 8, 8.1, 10 and 11.
Compiler : RadStudio 11 Update 3 + Patch 01
With the FluentApi.dll standalone API, you can experiment with Fluent effects in your applications without using FMXInno.
It functions similarly to FMXInno but comes with some limitations.

Here are examples of how to use FluentApi.dll in:

1. InnoSetup
2. VCL - Delphi
3. FMX - Delphi

NOTE:
1. Change the form fill color to Null.
2. Enable DoubleBuffered for InnoSetup / VCL.


>> Double Buffered:

For Inno/VCL, it's important to enable double buffering for forms before using fluent effects.
However, the original version of InnoSetup doesn't support double buffering natively but requires the enhanced edition.
Therefore, I have provided you with two DLLs that enable double buffering for forms in InnoSetup.

If you know a better way to achieve this, let me know, as in this case, 'WS_EX_COMPOSITED' does not work.

IS5Extra.dll ==> for InnoSetup 5.x
IS6Extra.dll ==> for InnoSetup 6.x






>> procedure FluentSetActiveThemeModeAwareness(const FluentHandle: Integer; FValue: Boolean);

In simple terms, if you change the system mode (dark/light) while the app is running,
the app will automatically change its mode (dark/light) to match the system mode.
However, this feature does not work for custom-colored fluent forms and is supported only on Win10 and Win11.





Code:
{ FluentType }
const
  FLUENT_DISABLE        = $0000;
  FLUENT_OPAQUE         = $0001;  // Windows 8/8.1
  FLUENT_TRANSPARENT    = $0002;  // Windows 10/11
  FLUENT_BLUR           = $0003;  // Windows 10/11
  FLUENT_ACRYLIC        = $0004;  // Windows 10/11
  FLUENT_INVALID_STATE  = $0005;

type
  TSysModeOnChanged = procedure(const ISDarkMode: Boolean);

function EnableFluent(const WinHandle: HWND; DarkTheme, NoBorders, NoTitleBar: Boolean; Opacity: Single; BrightnessPct: Byte): Integer;
(* Return Value =  FluentHandle *)
function EnableFluentEx(const WinHandle: HWND; VCLColor: Integer; NoBorders, NoTitleBar: Boolean; Opacity: Single; BrightnessPct: Byte): Integer;
(* Return Value =  FluentHandle *)
function EnableFluentNull(const WinHandle: HWND; NoBorders, NoTitleBar: Boolean): Integer;
(* Return Value =  FluentHandle *)

procedure FluentChangeToDarkMode(const FluentHandle: Integer; FDarkMode: Boolean);
procedure FluentChangeColor(const FluentHandle, VCLColor: Integer);
procedure FluentChangeType(const FluentHandle, FluentType: Integer);
procedure FluentSuspend(const FluentHandle: Integer);
procedure FluentResume(const FluentHandle: Integer);
procedure FluentSetActiveThemeModeAwareness(const FluentHandle: Integer; FValue: Boolean; ThemeOnChanged: TSysModeOnChanged);
procedure FluentWin10RedrawOnUpdate(const FluentHandle: Integer; FValue: Boolean);
procedure FluentDisableOnDeactive(const FluentHandle: Integer; const FDisable: Boolean);  (* For Windows 11 Only*)
procedure FluentShutdown(const FluentHandle: Integer);

// Extra:
function IsWinDarkModeEnabled: Boolean;
function IsWinTransparencyEnabled: Boolean;
function GetWinAccentColorVCL: TColor;
function EnableWinTransparency(Enabled: Boolean): Boolean;
.
Attached Images
File Type: png w00.png (55.8 KB, 154 views)
File Type: png w01.png (35.1 KB, 150 views)
File Type: png w02.png (50.4 KB, 156 views)
File Type: png w03.png (58.6 KB, 154 views)
File Type: png w70.png (64.2 KB, 155 views)
File Type: png w71.png (38.7 KB, 150 views)
File Type: png w72.png (59.7 KB, 152 views)
File Type: png w73.png (72.4 KB, 152 views)
Attached Files
File Type: rar FLuentApi + Examples [2023-Nov-13].rar (787.7 KB, 55 views)

Last edited by BLACKFIRE69; 15-11-2023 at 17:44.
Reply With Quote
The Following 8 Users Say Thank You to BLACKFIRE69 For This Useful Post:
ADMIRAL (30-11-2023), audiofeel (15-11-2023), Cesar82 (16-11-2023), Dunnowho69 (08-04-2025), hitman797 (15-11-2023), Lord.Freddy (15-11-2023), nordi (24-02-2024), Razor12911 (15-11-2023)
Sponsored Links