CreateParented replacement

  

I have an FMX form in a DLL, which is invoked from another application.
How can I provide the parent handle and apply that parent handle to show my form modal?

In VCL the following was used in the custom form constructor:

inherited CreateParented(hParent);

Edit:

Main question is how from FMX form can I show modal another FMX form using handles only? Currently I have the following code:

var
fmAbout: TMyForm;
hWin: TWinWindowHandle;
begin
fmAbout := TMyForm.Create(nil);
try
hWin := WindowHandleToPlatform(fmAbout.Handle);
Winapi.Windows.SetParent(hWin.Wnd, hParentHandle);
fmAbout.ShowModal;
finally
fmAbout.Free;
end;
end;

This code works, but AboutForm with property Position=OwnerFormCenter is displayed at the screen center, with property Position=MainFormCenter this is aligned at the center of the main form, not the owner form. How can I fix that?

Comments are closed.