1

アプリケーションのセットアップには inno setup を使用します。インストールする前に、アプリがまだ実行されていることを確認し、taskkill コマンドを使用してアプリケーション フォースを強制終了します。しかし、トレイアイコンが消えないことがわかりました。

アプリケーションを穏やかに終了する方法、または強制終了後にトレイ アイコンをトレイから削除する方法は?

4

1 に答える 1

2

I had the exact same problem, and fixed it with a simple change to my bat file and without having to install any other programs.

The problem was I was running taskkill with /f wich forces (hard) kills the task. If you kill it without the /f it sends a close signal to the application, the application exits cleanly and removes its system tray icon.

In my bat file I do two taskkill commands; the first without the /f and then again with the /f. If the first one works (which it usually should) then all is well and the system tray icon goes away. If for some reason the first one fails, the the second one will still kill it, although in that case the system tray icon would not be removed.

So, in my case, I use:
taskkill /t /im Memu*
taskkill /f /t /im Memu*

Works great :-)

于 2019-11-09T01:54:54.370 に答える