Bill Seven
Bill Seven

Reputation: 768

Delphi - How Control Z Order Of TOpenDialog

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 get the TOpenDialog to open without affecting the Z order of the modal dialog?

Thanks!

Upvotes: 3

Views: 1650

Answers (1)

Ken White
Ken White

Reputation: 125718

What version of Delphi are you using? Delphi 2007 and up add an overloaded TOpenDialog.Execute(ParentWnd: HWND); passing the handle of your modal dialog as the ParentWnd when calling Execute() may help.

For future reference, make sure you specify which version of Delphi. Answers appropriate to Delphi 2009, for example, wouldn't be of much use to you if you were using Delphi 5, and would be a waste of time for the person providing the answer.

Upvotes: 5

Related Questions