FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   Windows Fluent Effects Standalone API - InnoSetup / VCL / FXM (https://fileforums.com/showthread.php?t=106125)

BLACKFIRE69 15-11-2023 17:35

Windows Fluent Effects Standalone API - InnoSetup / VCL / FXM
 
9 Attachment(s)
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


https://i.ibb.co/PTjv113/db1.png https://i.ibb.co/ZYvyXpq/db2.png



>> 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.


https://i.ibb.co/nP00qH5/00.gif


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;

.


All times are GMT -7. The time now is 18:47.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com