Search code examples
windowsdelphimedia-playerdelphi-7forceclose

Closing delphi app along with another application it opened


I have an application that called several other .exe components written in delphi. The question I ask is that is it possible to close the delphi app along with all application it opened (when clicking the '[x]' button)?

Also, obviously, I have learned how to open and close external application, but in several cases like Windows Media Player it just doesn't seem to work... can anyone give me some solution to this?

Thanks in advance


Solution

  • If you keep track of the applications you open, you can post a WM_QUIT message to each one's window handle in the OnClose event of your Delphi app's main form.

    The same should work for Media Player, but it's hard to say when you don't give any information about how you opened it.