Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Forms 具有Firemonkey的多个窗体在windows菜单中显示多个项目_Forms_Delphi_Firemonkey - Fatal编程技术网

Forms 具有Firemonkey的多个窗体在windows菜单中显示多个项目

Forms 具有Firemonkey的多个窗体在windows菜单中显示多个项目,forms,delphi,firemonkey,Forms,Delphi,Firemonkey,我目前正在用Firemonkey做实验,遇到了这个问题。 当我的应用程序中有多个表单时,我会得到相同数量的项目 在一个应用程序的“我的windows”菜单栏中(请参见屏幕截图) 在常规VCL应用程序中,只有一个项目标识该应用程序 (所以我的截图只包含“Form2”项) 有人知道我如何才能实现与VCL应用程序相同的行为吗, 所以我的多表格申请只有一个项目 提前谢谢 提斯 编辑:我设法显示了第二个表单,在底部菜单只有一项,但是表单的属性“透明度”必须为真!因此,为了使第二个表单可见,需要在第二个表

我目前正在用Firemonkey做实验,遇到了这个问题。 当我的应用程序中有多个表单时,我会得到相同数量的项目 在一个应用程序的“我的windows”菜单栏中(请参见屏幕截图)

在常规VCL应用程序中,只有一个项目标识该应用程序 (所以我的截图只包含“Form2”项)

有人知道我如何才能实现与VCL应用程序相同的行为吗, 所以我的多表格申请只有一个项目

提前谢谢

提斯


编辑:我设法显示了第二个表单,在底部菜单只有一项,但是表单的属性“透明度”必须为真!因此,为了使第二个表单可见,需要在第二个表单中放置一个树形角(没有带标题和按钮的框架可见).

我找到了解决方法

当您创建具有所有者的表单时,FireMonkey应该将所有者向下传递给Windows
CreateWindowEx
函数,但它没有

在unit
FMX.Platform.Win
中,在
CreateWindow()
函数中,更改以下内容:

  Wnd := CreateWindowEx(ExStyle, WindowClass.lpszClassName, PChar(AForm.Caption), Style,
    Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT),
    GetDesktopWindow, 0, hInstance, nil);
为此:

  // If there's an owner, and it's a form, then create the window as a child
  if (AForm <> nil) and (AForm.Owner <> nil) and (AForm.Owner is TForm) then
  begin
    // Child window
    Wnd := CreateWindowEx(ExStyle, WindowClass.lpszClassName, PChar(AForm.Caption), Style,
      Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT),
      HandleToHWND(TForm(AForm.Owner).Handle), 0, hInstance, nil);
  end
  else
  begin
    // Desktop window
    Wnd := CreateWindowEx(ExStyle, WindowClass.lpszClassName, PChar(AForm.Caption), Style,
      Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT),
      GetDesktopWindow, 0, hInstance, nil);
  end;
然后,在修复之后,一切都将按预期工作


不要忘记从项目设置中的自动创建表单列表中删除子表单。

在Vista中也会发生。。。至少对于fmx…我在编辑'fmx.Platform.Win'文件时遇到困难,我无法正确保存它。我将进一步尝试,但我希望找到一个解决方案,而不必更改FMX文件。如果我将其作为新文件添加到我的项目中并应用更改,它就会工作。我希望在不必更改源FMX文件的情况下找到一个解决方案,因为我还试图使用monkeymexer()将其添加到我的VCL项目中。
MyModalForm := TMyModalForm.Create(MyParentForm);
MyModalForm.ShowModal;