Close Processes in “Check for running processes” does not work correctly on Windows

天涯浪子 提交于 2019-12-11 02:37:28

问题


there is a little problem with closing running processes (without an 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.

On macOS it is working fine.

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?

Thanks :)


回答1:


Soft close is not guaranteed to succeed. On Windows it works like this:

  • "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.

  • "Terminate" operates on the process and calls TerminateProcess which succeeds without the cooperation of the application.



来源:https://stackoverflow.com/questions/49859793/close-processes-in-check-for-running-processes-does-not-work-correctly-on-wind

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!