【问题标题】:Windows Mobile C++ Tray IconWindows Mobile C++ 托盘图标
【发布时间】:2011-11-21 05:27:44
【问题描述】:

我正在尝试将主要在后台运行的应用程序放置在 Windows Mobile 6.5 上的“托盘状”区域中。

我通过 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;
}

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

Tray icon within the 'today' area http://www.fotoszok.pl/upload/666d99dc.jpg

Shell_NotifyIcon 会执行此操作,但图标未显示在今日屏幕上,我可以从任何地方看到它在托盘中除了今日/主屏幕。

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

【问题讨论】:

    标签: c++ winapi windows-mobile


    【解决方案1】:

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

    此函数向系统发送消息以从任务栏状态区域添加、修改或删除特定于应用程序的图标。它不会影响出现在主屏幕上的图标。

    您可以尝试使用SHNotificationAdd

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多