I am using OpenDialog in Delphi 5. My problem is it opens at the back of My Application forms. I set My application form at the TOP using following code
if UpperCase(SmSession.ApplicationName) = 'MYAPP' then
begin
Params.ExStyle := Params.ExStyle or WS_EX_TOPMOST;
exit;
end
, so the windows dialog box might be at the back. How can I take it to front without changing my application forms code ?
This is my code to openDialog:
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;
end;
This Property I was using for keep my application window on top always. Params.ExStyle := Params.ExStyle or WS_EX_TOPMOST;
now i commented this line and use another following property
Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
Params.WndParent := GetDesktopWindow;
it works.