2

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

4

2 回答 2

4

您可以使用Job Objects、阅读这些功能的文档CreateJobObjectAssignProcessToJobObject.

作业对象允许将进程组作为一个单元进行管理......示例包括强制执行限制,例如工作集大小和进程优先级或终止与作业关联的所有进程

于 2012-04-03T04:14:33.823 回答
1

如果您跟踪您打开的应用程序,您可以在Delphi 应用程序的主窗体事件中WM_QUIT向每个窗口句柄发布消息。OnClose

媒体播放器也应该这样,但是当您不提供有关如何打开它的任何信息时,很难说。

于 2012-04-02T05:21:28.227 回答