8
votes

I'm maintaining an application originally written in Delphi 7 and ported to Delphi XE.

Using Windows 7, we have experienced some problems like modal windows appearing under the main window and the eventual inability to interact with the program because the user is expected to interact with the modal form and that's impossible since it's under the main window.

To avoid this problem I changed the MainFormOnTaskBar property of the project to True (older projects don't have this property) and now I continue with the same project. Reading documentation I found the new Form property PopupParent. Is it mandatory to use this property if I set MainFormOnTaskBar to True? Is there another solution to this problem?

1

1 Answers

8
votes

Yes, for the modal forms that "pop-under", you have to fix the Z-order using PopupParent or PopupMode, as explained by Allen Bauer in his blog post PopupMode and PopupParent.

MainFormOnTaskBar documentation says it has little to do with the pop-under: it is for choosing where the Title/Icon information on the taskbar is obtained from (your Application or MainForm).

However, MainFormOnTaskBar := True does more and this article by Steve Trefethen (ex Delphi team member) explains many more details it in more detail.

This "more" has consequences involving z-order. Some you might like more or maybe less, so here are are a few examples:

Note that fighting the issues introduced with Vista were no small feat to solve as Microsoft introduced a lot more functionality but also took away some freedom applications used to have. Read these two articles by Nathanial Woolls to get a better impression on those.