SpeedFan 重新启动后,使旧图标从系统托盘中自动消失

Mat*_*Wai 5 icons speedfan notification-area batch-file

@echo off
taskkill /F /T /IM speedfan.exe
start "" "C:\Program Files (x86)\SpeedFan\speedfan.exe"
cls
exit
Run Code Online (Sandbox Code Playgroud)

每次电脑从睡眠模式唤醒后,我在.bat文件中使用上述命令自动重启SpeedFan。

但是,系统托盘中的旧 SpeedFan 图标不会在新出现时自动消失。我必须手动将光标移动到旧图标以使其消失。如何让它自动消失?

我刚刚找到了一个简单的解决方案:从http://www.autohotkey.net/~Nazzal/Other/NoTrayOrphans.exe下载 NoTrayOrphans.exe

感谢大家的帮助!

Lim*_*mer 1

现在寻求正确的答案。

只需使用一个简单的 AutoIt 脚本代替taskkill /F /IM

 WinClose("SpeedFan")
Run Code Online (Sandbox Code Playgroud)

您只需确保 SpeedFan 配置(“选项”-选项卡)中禁用“关闭时最小化”即可。


如果这不是一个正确的答案,我很抱歉,并且我无法用个人经验来支持它,但是您是否尝试过找到解决方案?

我的一般方法是进行虚拟鼠标移动或使用一些Windows-api 调用来强制窗口刷新通知区域

我从来没有做过类似的事情,但经过几次搜索后我得到了这个谷歌搜索字符串:windows refresh icons "system tray" OR "notification area" autohotkey OR autoit

一个好看的结果:AHK - ow-to-refresh-system-tray-icons
另一个:(autohotkey.com/board/topic/80624-notrayorphans/在上面的线程中链接)

其他结果(不含autohotkey OR autoit):

  1. 刷新通知区域系统托盘
  2. forum.lazarus.freepascal.org/index.php?topic=14847.0
  3. blog.stephenklancher.com/2013/08/refreshing-the-notification-area-system-tray/(具有可执行文件- 但它似乎不适用于带有 classic-shell 的 Windows 8.1)

SO 上有一个可能的重复(我记得看到了更多,但我似乎找不到它们): stackoverflow.com/questions/74723/can-you-send-a-signal-to-windows-explorer-to-make-it-refresh-the-systray-icons

不幸的是,我无法发布更多直接链接,我更愿意写评论而不是这个“答案”......