TrayIcon 气球不显示
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我自己想出来了。
nid.cbSize = sizeof( NOTIFYICONDATA_V2_SIZE );
应该是nid.cbSize = NOTIFYICONDATA_V2_SIZE;
Ok I figured it out myself.
nid.cbSize = sizeof( NOTIFYICONDATA_V2_SIZE );
should benid.cbSize = NOTIFYICONDATA_V2_SIZE;