Windows Mobile C++ 托盘图标 [英] Windows Mobile C++ Tray Icon

查看:23
本文介绍了Windows Mobile C++ 托盘图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将主要在后台运行的应用程序放置在 Windows Mobile 6.5 上的类似托盘"的区域中.

I'm trying to place my application that is mainly running in the background in a 'tray-like' area on the Windows Mobile 6.5.

我用 Shell_NotifyIcon 很明显地做到了

I do it the obvious way by with Shell_NotifyIcon

BOOL ShowTrayIcon(HWND hWnd, HINSTANCE hIns, BOOL bShowIcon)
{
BOOL bRet = FALSE;

g_structNotifyIconData.cbSize = sizeof(NOTIFYICONDATA);
g_structNotifyIconData.hIcon = LoadIcon(hIns, MAKEINTRESOURCE(IDI_GPSCOMPASS));
g_structNotifyIconData.hWnd = hWnd;
g_structNotifyIconData.uCallbackMessage = WM_SYSTRAY_MSG;
g_structNotifyIconData.uFlags = NIF_MESSAGE | NIF_ICON;
g_structNotifyIconData.szTip[0] = 'Bzz';
g_structNotifyIconData.uID = ID_TRAY;

if (bShowIcon)
bRet = Shell_NotifyIcon(NIM_ADD, &g_structNotifyIconData);
else
bRet = Shell_NotifyIcon(NIM_DELETE, &g_structNotifyIconData);


return bRet;
}

这是我试图放置图标的地方:

This is where i am trying to place the icon :

今天"区域内的托盘图标 http://www.fotoszok.pl/upload/666d99dc.jpg

Shell_NotifyIcon 可以执行此操作,但该图标未显示在今日"屏幕上,我可以从任何位置除了今日/主屏幕看到它在托盘中.

The Shell_NotifyIcon does the thing but the Icon is not shown on the Today screen, i can see it's in the tray from any place except the Today/Home screen.

现在我在某处读到这是因为今天屏幕中的托盘区域是为系统通知保留的,我们"不能在其中放置任何图标 - 如果这是真的,有人可以确认一下吗?

Now I've read somewhere that this is because the Tray area in Today screen is reserved for system notifications and 'we' can't place any icons in there - well if that's true, can somebody please confirm that?

推荐答案

确实,Shell_NotifyIcon 不支持在今天"屏幕中添加图标.这甚至是函数文档中提到的第一件事:

Indeed, Shell_NotifyIcon doesn't support adding the icon in the Today screen. This is even one of the first things mentioned in the function documentation:

此功能向系统发送消息,以从任务栏状态区域添加、修改或删除特定于应用程序的图标.它不会影响主屏幕上显示的图标.

您可以尝试使用 SHNotificationAdd.

这篇关于Windows Mobile C++ 托盘图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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