问题描述
关闭正在运行的进程有一点问题(没有ui)。
there is a little problem with closing running processes (without an ui).
我们正在编写一个没有(主)ui的应用程序用于打开首选项的托盘图标。
We're writing an application which doesn't have an (main) ui except a tray icon for opening preferences.
我在安装过程中添加了检查运行进程和允许软关闭并终止选项。
I added a "Check for running processes" with "Allow soft close and termination" option to the installation process.
如果我尝试安装我的应用程序的新版本,我收到消息,我的应用程序正在运行,但是如果我点击关闭进程,则没有任何反应,只有在终止进程中,它将被终止。
If I try to install a new version of my application I get the message, that there is a running process of my application, but if I click on "Close processes", nothing happens, only on "Terminate processes" it will be killed.
如果我打开应用程序的首选项窗口,窗口将被关闭,但不会关闭进程本身。
If I open the preferences window of my application the window will be closed but not the process itself.
在macOS上工作正常。
On macOS it is working fine.
我们使用的是最新的install4J-6版本。
We're using latest install4J-6 version.
我是否必须设置另一个选项,还是必须启动一个终止我的申请的脚本?
Do I have to set another option or do I have to launch a script which will terminate my application?
谢谢:)
推荐答案
无法保证软关闭成功。在Windows上,它的工作方式如下:
Soft close is not guaranteed to succeed. On Windows it works like this:
-
软关闭发布
WM_CLOSE
消息到进程的所有可见窗口。如果应用程序不合作,这可能不起作用,例如,如果正在显示模式对话框。
"Soft close" posts a
WM_CLOSE
message to all visible windows of a process. This may not work if the application does not cooperate, for example if a modal dialog is being displayed.
终止对进程进行操作并调用 TerminateProcess
在没有应用程序合作的情况下成功。
"Terminate" operates on the process and calls TerminateProcess
which succeeds without the cooperation of the application.
这篇关于关闭“检查正在运行的进程”中的进程在Windows上无法正常运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!