How do I get a WinAPI HWnd in a FireMonkey application? [duplicate]


This question already has an answer here:

Delphi Firemonkey Cross Platform – Generic way to pass a Windows Handle

1 answer

We have written a FireMonkey application using Delphi XE8.

In a Delphi 2010 VCL application I’d pass Application.Handle and it worked perfectly.

We are trying to send an email using MAPI, but we are getting a compile error on Application.Handle.

The code:

If MAPIModule=0 then
If @SM<>nil then
Result:=SM(0,Application.Handle,Email_message,MAPI_DIALOG or MAPI_LOGON_UI,0);

The compile error is: Undeclared identifier: ‘Handle’

If I hover over ‘Application’ in the code, I see Application – FMX.Forms.TApplication, and if I hover over the ‘Handle’ it says TApplication does not have a member named ‘Handle’.

Comments are closed.