windowsDelphi中其他应用形式后台打开OpenDialog,如何调到最前面?

windows OpenDialog open at background of other forms of application in Delphi, How to bring it at front?

我在 Delphi 5 中使用 OpenDialog。我的问题是它在我的申请表后面打开。我使用以下代码

将我的申请表设置在顶部
if UpperCase(SmSession.ApplicationName) = 'MYAPP' then
begin
  Params.ExStyle := Params.ExStyle or WS_EX_TOPMOST;
  exit;
end

,所以 windows 对话框可能在后面。我怎样才能在不更改申请表代码的情况下把它放在前面?

这是我打开对话框的代码:

EditParent.OpenDlg.InitialDir := EditParent.FDefaultDir;
EditParent.OpenDlg.FileName := EditParent.FFileName;

if EditParent.OpenDlg.Execute then
Begin
  SplitFileDir(EditParent.OpenDlg.FileName, TmpDir, TmpFile);
  if EditParent.ShowOnlyFileName then
    EditParent.FileName := TmpFile
  else
    EditParent.FileName := EditParent.OpenDlg.FileName;
  EditParent.Directory := TmpDir;
  EditParent.SetPeerDirectoryBrowser;
End;
EditParent.OpenDlg.Free;
inherited Click;

结束;

这个 属性 我用来让我的应用程序 window 始终保持在顶部。 Params.ExStyle := Params.ExStyle 或 WS_EX_TOPMOST;

现在我评论了这一行并使用了另一行 属性 Params.ExStyle := Params.ExStyle 或 WS_EX_APPWINDOW;
Params.WndParent := GetDesktopWindow;
有用。