Delphi FMX – click through form. HitTest not available

This post shows you how to create a Delphi FireMonkey (FMX) form that the user can click through as if the form did not exist.

The form can be transparent or not transparent

Many FMX components have a HitTest property.  If you set this to FALSE, the mouse will click through the component as if it is not there.  Unfortunately, TForm does not have this HitTest property, but you can achieve the same result with this …

// uses FMX.Platform.Win
//     ,Windows;

   FmxHandleToHWND(Handle) // convert FMX handle to Windows hwnd handle

If it doesn’t work …

Some window operations will prevent the code from working so make sure you call the above code after you do any of the following

  • Making the window OnTop
    self.FormStyle := TFormStyle.StayOnTop;
  • Bringing the window to the front
  • Anything that causes the SetWindowLong call to not work.


This solution will only work on Microsoft Windows.
Please post a comment if you know how to add click through to a FireMonkey form on other platforms.

About Me


  • Oracle & Delphi software developer based in Perth, Western Australia
  • Australian Delphi User Group – WA branch manager, past national president
  • Australian Oracle User Group – WA State Committee Member
  • Available to do remote presentations to user groups on Delphi and Oracle topics
blog email linkedinlogo

Published by

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: