如何刷新系统托盘 [英] How to refresh the system tray

查看:155
本文介绍了如何刷新系统托盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我创建了一个MFC应用程序,该应用程序在系统托盘中运行。一旦完成了这个特定的应用程序的工作,我正在使用另一个MFC应用程序杀死该进程。现在我面临的问题是,即使在应用程序终止后,系统托盘中仍然可以看到图标,并且这些图标直到我才被清除将鼠标移到托盘上。



先谢谢

Hello,

I have created an MFC application and this application runs in the system tray. Once the work is done with this particular application i am killing the process using another MFC application.Now the problem i am facing here is even after the application is terminated the icon is still visible in the system tray and those icons are not cleared until i move my mouse on the tray.

Thanks in Advance

推荐答案

而不是从外部杀死进程,设置它以便您可以发送消息,并发送请终止消息,以便它可以清理并优雅地终止。
Rather than kill the process externally, set it up so that you can send it a message, and send a "please terminate" message so that it can clean things up and terminate itself gracefully.


NOTIFYICONDATA nid={0};
nid.cbSize = sizeof(NOTIFYICONDATA);
nid.hWnd = hWnd;
nid.uID = 1; //your num
Shell_NotifyIcon( NIM_DELETE, &nid);


您好


您可以使用 :: Shell_NotifyIcon(NIM_REMOVE,& address_of_oldicon); 只是为了获得更多相关信息,您可以在google.com上搜索我相信这个关键词对您有用;)另外请查看以下链接:



在Win32中基本使用Shell_NotifyIcon [ ^ ]

将图标添加到系统托盘 [ ^ ]

http://msgroups.net/microsoft.public.vc.mfc/refresh-system-tray/547778 [ ^ ]



最好的问候。
Hi
You can do it with ::Shell_NotifyIcon(NIM_REMOVE, &address_of_oldicon); just for getting more information about it you can search in google.com I am sure this key word can be useful for you ;) Additionally please review follow of links:

Basic use of Shell_NotifyIcon in Win32[^]
Adding Icons to the System Tray[^]
http://msgroups.net/microsoft.public.vc.mfc/refresh-system-tray/547778[^]

Best Regards.


这篇关于如何刷新系统托盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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