当进程被杀死时,系统任务栏图标仍然存在 [英] System tray icon sticks around when process is killed

查看:287
本文介绍了当进程被杀死时,系统任务栏图标仍然存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我使用MFC创建了带有系统任务栏图标的应用程序.当我杀死该进程时,该进程在任务管理器中不再可见,但是任务栏图标仍显示在系统任务栏中.一旦将鼠标悬停在任务栏图标上,它就会消失.

为什么会发生这种情况,如何避免呢?

一旦我终止了该进程,任务栏图标就会从系统任务栏中消失.

感谢您提供任何提示!

Hi,

I created an application with a system tray icon using using MFC. When I kill that process the process is no longer visible in the task manager, but the tray icon is still showing in the system tray. Once one does a mouse-over on the tray icon it disappears.

Why is this happening and how can it be avoided?

Once I kill the process the tray icon should vanish from the system tray.

Thanks for any hints!

推荐答案

这是设计使然.将图标放入系统任务栏后,该图标归系统所有.由系统来监视它是否在那里.如果您确实想在程序被杀死时删除该图标,则需要编写一个单独的看门狗应用程序来完成该任务
it is by design. Once you''ve placed the icon in the System Tray it is owned by the system. It is up to the system to monitor if it''s there. If you really want to remove the icon when your program is killed, you need to write a separate watch dog application that will do just that


这篇关于当进程被杀死时,系统任务栏图标仍然存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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