vhanla 2 Posted August 17, 2023 (edited) I'm using MonkeyMixer IDE plugin to allow inserting a new FMX form inside my VCL project. I'm launching the FMX form using: Form2.Parent := Form1; Form2.Show; However, the Form2 (FMX form), its FormStyle is set to StayOnTop. But the new child windows won't show inheriting the WS_EX_TOPMOST GWL_EXSTYLE from the Form2 (fmx window), which indeed, it is TOP MOST. So the result is something like this: - The context menu shows behind the form. - The ShowMessage also shows behind that form. - And if I close that Form2, the ShowMessage window still remains there. Important: The context menu (PopupMenu) and the ShowMessage box belongs to the Form2 (FMX form). Notice that this works correctly in a pure FMX project, but this issue only happens in the mixed methods. I guess it has something to do with the VCL forms interfering with the FMX forms handling, since using VCL styles, seems to be applied in the FMX form but partially, as shown in the following picture: Do you know how to fix that? [EDIT] I found a hardcoded "workaround", which is to modify the FMX.Platform.Win.pas file modifying the function TPlatformWin.CreateAppHandle:HWND; adding WS_EX_TOPMOST 😅, it "works as expected" now, but it will turn all TOPMOST: Result := CreateWindowEx(WS_EX_WINDOWEDGE or WS_EX_TOPMOST or WS_EX_TOOLWINDOW, FMAppClass.lpszClassName, PChar(FTitle), WS_POPUP or WS_GROUP, 0, 0, 0, 0, GetDesktopWindow, 0, hInstance, nil) Edited August 17, 2023 by vhanla Add more info. Share this post Link to post
Remy Lebeau 1433 Posted August 17, 2023 Have you tried making the FMX form override its CreateHandle() method to apply the WS_EX_TOPMOST style? Share this post Link to post
#ifdef 12 Posted December 23, 2023 On 8/17/2023 at 6:19 AM, vhanla said: Form2.Parent := Form1; Form2.Show; But how? [dcc32 Error] uMainForm.pas(27): E2010 Incompatible types: 'TFmxObject' and 'TForm1' Share this post Link to post