Delphi - How to manage Z Order of TopDialog

I have a modal dialog that is created with the following:

procedure TFormCompose.createParams(var Params: TCreateParams);
begin
     inherited createParams(Params);
     with Params do begin
          exStyle:=exStyle or WS_EX_APPWINDOW;
          wndParent:=getDesktopWindow;
     end;
end;

In this form, I create an instance of TOpenDialog. When it opens, it sends my first modal dialog behind the main application window.

Is there a way to open TOpenDialog without affecting the Z order of the modal dialog?

Thanks!

+3
source share
1 answer

What version of Delphi are you using? Delphi 2007 and add overloaded TOpenDialog.Execute (ParentWnd: HWND); passing the handle to your modal dialog, since ParentWnd can help when calling the Execute () function.

Delphi. , Delphi 2009, , , Delphi 5, , .

+5

Source: https://habr.com/ru/post/1711108/


All Articles