Sign in Join

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

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

FMXBridge

Delphi FireMonkey DLL with an Inno Setup Pascal Script wrapper for creating FMX forms, controls, visual effects, and Windows-integrated UI. Supports Win32 and Win64.

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

FMXBridge

A ready-to-use release is available. Download FMXBridge v0.8 for the demo-test package, including the files needed to build the Inno Setup demos and prebuilt FMXBridge DLLs for both x86 (Win32) and x64 (Win64).

FMXBridge is a Delphi DLL project that exposes FireMonkey (FMX) forms, controls, graphics, effects, and helper functionality to Windows host applications. It is particularly aimed at using FMX UI from Inno Setup through a Pascal Script interface, without separately installing every component into the IDE.

The repository contains both sides of the integration:

  • FMXBridge.dpr and the Pascal units that build the DLL.
  • FMXBridgeHandle.iss, the Inno Setup include file containing the matching Pascal Script interface declarations, imported-function declarations, types, constants, and helper routines.

Features

The source tree includes:

  • Forms and Windows integration — main/message/splash forms, custom title-bar controls, and window helpers.
  • DWM and window appearance — backdrop effects, blur, dark mode, border color, and rounded corners.
  • Standard and additional FMX controls — buttons, labels, edit controls, check boxes, radio buttons, panels, lists, trees, menus, progress controls, spinners, page controls, and more.
  • Animations, effects, and transitions — property animations, FMX effects, and transition effects.
  • 2D and 3D graphics — shapes, text, viewports, cameras, lights, models, and material sources.
  • Image, text, and audio support — SVG, GIF, WebP, HTML-formatted text, and optional MP3 playback.
  • Utilities — storage/system information, timers, a stopwatch, network downloads, dialogs, and media-related functionality.
  • Windows notifications — Toast notifications sent by the currently running Inno Setup process through Windows Runtime.
  • Optional integrations — FMXAudioLib-based MP3 audio support, Skia4Delphi wrappers, and RadiantShapes wrappers.

The Pascal units and Examples/Modules/FMXBridgeHandle.iss are the definitive references for available interfaces, method signatures, parameter types, interface identifiers, and exported names.

Examples

FMXBridge includes 75 Inno Setup demo scripts showing how to use FireMonkey forms, controls, graphics, animations, and Windows integration from Pascal Script.

FMXBridge examples

The Examples/ directory contains 55 demos covering:

Supporting assets used by these demos are stored in Examples/Files/.

Skia4Delphi examples

The Examples/Skia/ directory contains 20 additional demos showcasing Skia4Delphi integration, including animated images, custom fonts, text rendering, SVG, path effects, and interactive shaders.

Start with Animated Paint Box — Mouse Interaction, Animated Images, or Path Shader.

Supporting Skia assets, including shaders, fonts, styles, and SVG files, are stored in Examples/Skia/Files/.

Preparing the examples

The demo scripts are source files, not precompiled installer executables. The FMXBridge v0.8 release provides a ready-to-use archive with the files required to build and test the Inno Setup demos, including the prebuilt 32-bit (FMXBridge_x86.dll) and 64-bit (FMXBridge_x64.dll) FMXBridge libraries.

For standard demos, use the included files and instructions in Examples/Modules/README.md. Skia4Delphi demos additionally require the matching Skia4Delphi native runtime DLLs and any optional dependencies not included in the release. See Examples/Skia/Modules/README.md for setup details.

Some demos may also require optional third-party components or additional resources. Refer to the project requirements and third-party notices for details.

Requirements

  • Embarcadero RAD Studio / Delphi with FireMonkey (FMX). The project is configured for Win32 and Win64. The checked-in Examples/Modules/FMXBridgeHandle.iss header identifies RAD Studio 13.2 / compiler build 37.0.60952.8797.
  • Inno Setup 7.0.0 or later to use the current Examples/Modules/FMXBridgeHandle.iss. The include file checks the Inno Setup version at compile time.
  • A compatible RadiantShapes FMX package to build the project as currently listed in FMXBridge.dpr. ThirdParty/FMXBridge.RadiantShapes.pas contains FMXBridge's wrapper/calls, not the RadiantShapes implementation. If you do not have the required package and usage rights, remove the related unit/export references and wrapper declarations before building.
  • A compatible Skia4Delphi installation if the SKIA conditional define is enabled. ThirdParty/FMXBridge.Skia.pas provides the FMXBridge-side wrapper; the full Skia4Delphi library is not vendored here.
  • Optional MP3 audio support is implemented in Custom/AudioPlayer/ using selected audio sources from FMXAudioLib and the PCMAudio output layer. See third-party notices for attribution and licensing details.

Some other components are included as source under ThirdParty/ or Custom/. See THIRD-PARTY-NOTICES.md for the sources and known licensing boundaries. Not every dependency is covered by the FMXBridge license.

Project structure

Path Purpose
FMXBridge.dpr DLL project source, unit list, architecture suffixes, and resource inclusion.
FMXBridge.dproj RAD Studio project settings.
Examples/Modules/FMXBridgeHandle.iss Main Inno Setup / Pascal Script interface declarations and imports for FMXBridge.
Examples/Skia/Modules/FMXBridgeHandle.iss Copy of the main FMXBridge handle include used by the Skia demo scripts.
Examples/Skia/Modules/FMXSkiaHandle.iss Additional Inno Setup declarations for the Skia4Delphi integration.
FMX/ Standard and additional FMX controls, layouts, effects, graphics, media, networking, and 3D interfaces.
Forms/ Forms, splash screen, title-bar controls, DWM helpers, and Windows utilities.
Custom/ Custom controls and helpers, including SVG, WebP, and the optional audio player.
Helpers/ Additional helper units.
Fix/ Modified FMX.Platform.Win.pas source. It retains Embarcadero's copyright notice and is excluded from the FMXBridge license.
ThirdParty/ Third-party source, wrappers, resources, and optional integrations, including the vendored Windows Toast notification manager. See THIRD-PARTY-NOTICES.md.
Examples/ 55 Inno Setup demos for FMXBridge, with supporting assets under Examples/Files/.
Examples/Modules/ Local module directory for FMXBridge demo scripts; see its README for setup instructions.
Examples/Skia/ 20 Skia4Delphi demos and their supporting assets.
Examples/Skia/Modules/ Local module directory for Skia4Delphi demos; see its README for setup instructions.

Build the DLL

  1. Open FMXBridge.dproj in RAD Studio.
  2. Select the Release configuration.
  3. Select Win32 and build the project.
  4. Select Win64 and build the project again.

The project uses architecture-specific DLL suffixes:

  • Win32: FMXBridge_x86.dll
  • Win64: FMXBridge_x64.dll

With the project's output settings, the expected output directories are Win32\Release\ and Win64\Release\. Building from a clean machine may require the external packages described above. The source has not been independently built in a clean environment while preparing this README.

Use FMXBridge from Inno Setup

Examples/Modules/FMXBridgeHandle.iss is part of the project; it is not necessary to recreate all the Pascal Script interfaces and external declarations manually.

1. Include the handle file

The handle files are stored with the example modules, not in the repository root.

For demo scripts directly inside Examples/, include the main handle file like this:

iss
#include "Modules\FMXBridgeHandle.iss"

For Skia demo scripts inside Examples/Skia/, include both handle files:

iss
#include "Modules\FMXBridgeHandle.iss"
#include "Modules\FMXSkiaHandle.iss"

The main handle file contains its own [Code] section and enforces Inno Setup 7.0.0 or later. If your installer script is stored elsewhere, adjust the relative include path accordingly.

2. Add the matching DLL to [Files]

The include imports FMXBridge functions using declarations of the form:

pascal
external 'InitFormHandle@files:FMXBridge.dll stdcall delayload';

Therefore, the installer must contain the architecture-matching DLL in its [Files] section under the internal name FMXBridge.dll, normally with the dontcopy flag so Inno Setup can extract it to a temporary location when it is first needed. The DLL bitness must match the process that loads it. The build output is suffixed _x86 or _x64, while the include expects FMXBridge.dll; select/rename the appropriate build output or use DestName: "FMXBridge.dll" in the matching [Files] entry.

Example for a Win32 build (adjust the path and architecture selection for your installer):

iss
[Files]
Source: "Win32\Release\FMXBridge_x86.dll"; DestName: "FMXBridge.dll"; Flags: dontcopy

If solid compression is enabled, place the DLL entry near the top of [Files] to avoid unnecessary extraction delays. See the Inno Setup documentation on using DLLs.

3. Create a form

For example, after including Examples/Modules/FMXBridgeHandle.iss, an installer can create a basic FMX form through the declared FForm interface:

pascal
[Code]
var
  MainForm: FForm;

procedure InitializeWizard;
begin
  MainForm := InitFormHandle;
  MainForm.FCreateBlankForm(WizardForm.Handle, ALBlack, '', False);
  MainForm.Caption('FMXBridge test');
  MainForm.Show;
end;

This snippet demonstrates the interface flow only; it is not a complete installer or a substitute for choosing the correct DLL architecture and required external packages. See the interface declarations in Examples/Modules/FMXBridgeHandle.iss for other methods and controls.

4. Shutdown helpers

The include defines FMXBridgeShutDown and FMXBridgeShutDownUn helpers. Inspect their implementations before using them: they call the FMXBridge shutdown export and EndTask for the Setup or Uninstall progress window. They are host-shutdown helpers, not generic safe-DLL-unload routines. Do not assume that manually unloading the DLL while imported functions or FMX objects remain in use is safe.

API model

The DLL exposes factory functions such as:

  • InitFormHandle and InitMsgFormHandle
  • InitToastHandle — sends a Windows Toast notification from the active Setup process.
  • InitButtonHandle
  • InitRectangleHandle
  • InitShadowEffect
  • InitViewport3DHandle
  • InitTimer and InitStopwatch

The corresponding Pascal units declare interfaces derived from IUnknown; interface methods generally use stdcall. Parameters can include FMX object handles (TFmxObject), Windows handles (HWND), WideString values, callbacks, and FMX-specific types. This is a Delphi/FireMonkey interface-based API rather than a generic C ABI. A host's declarations must match the exports, calling conventions, interface identifiers, and parameter/return types.

The DLL and Examples/Modules/FMXBridgeHandle.iss contain matching sides of this API. If you add, remove, or change an exported function or interface in the Delphi project, update the Inno Setup declarations accordingly. Optional modules can be removed, but remove the associated unit, export, wrapper, resource, and package references together.

Credits and acknowledgements

FMXBridge is an independent project influenced by work from the Delphi and Inno Setup communities. Thank you to the following authors and projects:

  • ISFMXFW — inspiration for exposing FireMonkey functionality to Inno Setup through a DLL. This is an acknowledgement of inspiration, not a claim that ISFMXFW source code is included.
  • FMXComponents by Zhao Yipeng — component ideas and approaches. Thank you for the contribution to the FMX community.
  • PicShow Components from Delphi Area — inspiration for the image-transition effect ideas in Custom/PicShow. No PicShow source code was copied or included; the FMXBridge implementation was written independently.
  • FMXAudioLib by HemulGM — MP3 decoding and audio-source functionality. See third-party notices for its licensing status and component attributions.
  • WindowsNotificationManager by HemulGM — Windows Toast notification support; MIT License. Its copied source and license are listed in third-party notices.
  • PCMAudio by HemulGM — PCM audio output layer; MIT License.
  • GIFImage for FireMonkey by Thomas Dannert — GIF support.
  • DzHTMLText by Rodrigo Depiné Dalpiaz — HTML-formatted text support.
  • FMXSVG by HemulGM — SVG support and related source.
  • Skia4Delphi — Skia integration and wrappers.
  • WebP support — the original source repository and author could not be identified by the FMXBridge author. If you recognise the source, please open an issue so the attribution can be corrected.
  • RadiantShapes — FMXBridge includes wrapper code/calls only, not the RadiantShapes implementation. Users need the required package and usage rights.
  • FMX.Platform.Win.pas — this platform unit was adjusted for FMXBridge. The approach to modifying it was learned from HemulGM; thanks for sharing the work.

See THIRD-PARTY-NOTICES.md for more detail. Each third-party component remains subject to its own license or vendor terms. Those terms are not replaced by the FMXBridge license.

Code style

The source intentionally contains very few comments. The author's preference is for comments to convey a directly useful fact rather than add a long explanation that merely restates the code.

License

The LICENSE file applies only to original FMXBridge code authored by audiofeel. It does not grant rights to third-party code or binaries, the modified Embarcadero platform source, FMXAudioLib-authored source whose upstream license is not specified, or the RadiantShapes package. Review THIRD-PARTY-NOTICES.md before redistributing the complete source tree or a DLL built from it.

The reference to ISFMXFW is an acknowledgement of inspiration. If any code was copied or adapted from that GPL-3.0 project, the licensing implications for those portions must be assessed separately.

Status

The repository includes the DLL source project, the Inno Setup handle include, and 75 demo scripts under Examples/, including a separate set of Skia4Delphi examples.

The v0.8 release is available. Its FMXBridge-Release.7z archive includes the files needed to build and run the Inno Setup demo tests, along with prebuilt FMXBridge DLLs for both x86 (Win32) and x64 (Win64). The demo installers themselves are provided as source scripts and must be compiled with Inno Setup. Skia4Delphi demos may require additional matching Skia runtime DLLs.

An automated build and test workflow is not currently included.

For questions, corrections, or attribution updates, use GitHub Issues.