delphitaskmanager

How to write a "child" application in Delphi like Office does?


Office 2016 behaves like an MDI application, although it isn't: if you open many files in Taskmgr.exe there is one EXCEL.EXE process running (tab "Details"):

Task Manager details list

But there are multiple entries in the tab "Processes" (which actually lists windows):

Task Manager "processes" (actually windows) list

When I open the first file Excel starts slow. But when I open the second and third file Excel is faster than first.

How to do this in a Delphi program?


Solution

  • Windows' Task Manager unneedingly uses misleading terms to what actually happens:

    Which situation do we have? One process displaying multiple windows. This can be accomplished easily just like ages ago: you just ensure only running one instance which handles multiple documents. Does not even need to be a true MDI for that.

    What you want on top is, that the Task Manager also groups multiple windows. How does Excel achieve this? Look at your taskbar: for each document a separate button exists, not only one in general for Excel itself. In your Delphi program you must ensure that each window must also appear on the taskbar: How to correctly have modeless form appear in taskbar along with its answer has evaluated many ways of doing so.