Sign in Join

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

Catalog · How the catalog works

Random project

FMXWindowsDispatch

Allow the FMX windows to process Windows messages

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

FMXWindowsDispatch

Add to form message event

pascal
type
  TForm5 = class(TForm)
    Label1: TLabel;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    procedure WMSize(var Message: TWMSize); message WM_SIZE;
  end;

...

procedure TForm5.WMSize(var Message: TWMSize);
begin
  Label1.Text := Message.Width.ToString + ':' + Message.Height.ToString;
end;

Add unit to uses

pascal
uses
  FMX.Windows.Dispatch;

And call AllowDispatchWindowMessages procedure when creating a window

pascal
procedure TForm5.FormCreate(Sender: TObject);
begin
  AllowDispatchWindowMessages(Self);
end;