TrayIcon 气球不显示

发布于 2024-08-01 19:36:58 字数 746 浏览 6 评论 0原文

我在 Visual Studio 2005 Express Edition 中编译了托盘图标实用程序 C++ 代码,托盘图标气球成功显示,但后来我删除了防火墙,切换到 Windows 防火墙,现在我使用另一个防火墙软件。 现在我运行了相同的项目,气球成功显示,但是当我重建它时,我再也看不到气球了。 我的 Shell_NotifyIcon 方法仍然返回 true。

这是代码:

nid.cbSize              = sizeof( NOTIFYICONDATA_V2_SIZE ); // i've tested NOTIFYICONDATA   //and nid as well

nid.hWnd                = hWnd;
nid.uID                 = uID;
nid.uFlags              = NIF_ICON | NIF_MESSAGE | NIF_TIP|NIF_INFO;
nid.dwInfoFlags         = 0x00000004;
strcpy(nid.szInfoTitle  , balloonTitle);
strcpy(nid.szInfo       , balloonMsg);
int ret = Shell_NotifyIcon( NIM_MODIFY, &nid );

有人能建议问题出在哪里吗? 似乎与操作系统有关,我的操作系统是 XP,我什至将“EnableBalloonTips”修改为 1.

Faran Shabbir

I compiled my trayicon utility c++ code in visual studio 2005 express edition and tray icon balloons showed up successfully but later I deleted my firewall, switched on to windows firewall and now I am on another firewall software. Now i ran my same project and balloons showed up successfully but when i rebuilt it, i can't see balloons anymore. My Shell_NotifyIcon method still returns true.

Here is the code:

nid.cbSize              = sizeof( NOTIFYICONDATA_V2_SIZE ); // i've tested NOTIFYICONDATA   //and nid as well

nid.hWnd                = hWnd;
nid.uID                 = uID;
nid.uFlags              = NIF_ICON | NIF_MESSAGE | NIF_TIP|NIF_INFO;
nid.dwInfoFlags         = 0x00000004;
strcpy(nid.szInfoTitle  , balloonTitle);
strcpy(nid.szInfo       , balloonMsg);
int ret = Shell_NotifyIcon( NIM_MODIFY, &nid );

Can anybody suggest where does the problem lie? it seems it is related to OS, my OS is XP and i've even modified "EnableBalloonTips" to 1.

Faran Shabbir

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酒几许 2024-08-08 19:36:58

好吧,我自己想出来了。 nid.cbSize = sizeof( NOTIFYICONDATA_V2_SIZE ); 应该是 nid.cbSize = NOTIFYICONDATA_V2_SIZE;

Ok I figured it out myself. nid.cbSize = sizeof( NOTIFYICONDATA_V2_SIZE ); should be nid.cbSize = NOTIFYICONDATA_V2_SIZE;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文