OpenDialog "stayontop" - FPC/Lazarus beats Delphi? lazarus / 13-General ---------------------------------------------------------------------- Troodon · 2007-03-27 23:25 Hello all-- I have run into an interesting problem: on Windows XP, upon launching an OpenDialog dialog from a Lazarus form, if I switch desktops using a desktop pager (such as VirtuaWin) and then I return to the original desktop, the OpenDialog is grayed out but it stays on top of the parent form window. That is the expected behavior and it is consistent with similar behavior in MS Word etc. However, that doesn't happen in Delphi 6 or Turbo Delphi. In effect, when I return to the original desktop, the Delphi OpenDialog shows under its parent form window! It shows this behavior despite the fact that it runs as a modal dialog. Congratulations are in order -- way to go, FPC/lazarus developers! Now please let me ask you a question: do you know why there is such a difference? Is there a "stayontop"-like property for the OpenDialog object in FPC that keeps it on top of its parent window when switching dektops? Cause I couldn't find one in Delphi that I can set programmatically. Thank you for any help you can provide. -t ---------------------------------------------------------------------- antonio · 2007-03-28 00:49 I think this happens because of something about the hook Delphi's dialogs do to centralize themselves on screen. _________ C compiler has been always free. Now Pascal is free as well. ---------------------------------------------------------------------- Troodon · 2007-03-29 12:11 I'm not sure  understand what you mean. I am relatively new to Delphi and I think "hooks" are functions that can be used to intercept messages sent to the main window, rather than  to dialogs. Am I wrong? Anyway, the OpenDialog behavior I described above looks like a Delphi bug to me. ---------------------------------------------------------------------- antonio · 2007-03-29 22:52 Have a look at TOpenDialog Delphi source... ---------------------------------------------------------------------- Troodon · 2007-05-18 18:03 I have found a workaround to the problem: the Dialogs.pas in TurboDelphi needs to be edited and rebuilt as per instructions available at http://www.installationexcellence.com/articles/VistaWithD elphi/Original/Index.html and OpenDialog, SaveDialog dialogs must be called with the parameter .Handle.