在Inno Setup中,如何更新通知区域(又名系统托盘)? [英] In Inno Setup, how can I update the notification area, (aka the system tray)?

查看:156
本文介绍了在Inno Setup中,如何更新通知区域(又名系统托盘)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Inno Setup中,如何更新通知区域(又名系统托盘)?具体来说,我在代码"部分中安装了一项服务,该服务在托盘中放置了一个图标.我想立即删除它,最好还是在代码"部分中删除它. (或者根本不将图标放在那里,但我认为这是不可能的).当我将鼠标移到该图标上时,它会立即消失. Inno可以将消息发送到托盘以便自动发生吗?

In Inno Setup, how can I update the notification area, (aka the system tray)? Specifically, I'm installing a service in the Code section which puts an icon in the tray. I'd like to delete it immediately, preferably still in the Code section. (Or not put the icon there at all but I don't think that's possible). When I move the mouse over the icon, it immediately disappears. Can Inno send a message to the tray so that this happens automatically?

推荐答案

我猜您正在使用taskkill杀死任务.如果不是,请忽略此答案:-)

I'm guessing you are using taskkill to kill the task. If not, please disregard this answer :-)

但是,如果是这样,那我将遇到完全相同的问题,只需对bat文件进行简单的更改即可解决此问题,而无需安装任何其他程序.

But, if so, then 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.

问题是我用/f夹心力(硬)运行taskkill杀死了任务.如果您在没有/f的情况下杀死它,它会向应用程序发送关闭信号,则该应用程序将干净退出并删除其系统任务栏图标.

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.

在我的bat文件中,我执行了两个taskkill命令;第一个不带/f,然后再带/f.如果第一个正常工作(通常应该如此),则一切正常,系统托盘图标消失.如果由于某些原因第一个失败,则第二个仍然会杀死它,尽管在这种情况下系统托盘图标不会被删除.

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.

因此,就我而言,我使用: taskkill/t/im Memu * taskkill/f/t/im Memu *

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

效果很好:-)

这篇关于在Inno Setup中,如何更新通知区域(又名系统托盘)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆