2011-09-20 89 views
2

我试图将我的应用程序主要在Windows Mobile 6.5的“托盘状”区域中的背景中运行。Windows Mobile C++托盘图标

我用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做的事情,但图标没有显示在今日屏幕上,我可以看到它在任何地方,除了今日/主屏幕在托盘中。

现在我已经在某处读到这是因为今天屏幕中的纸盘区域保留用于系统通知,并且'我们'不能在其中放置任何图标 - 如果确实如此,是否有人可以确认?

回答

1

事实上,Shell_NotifyIcon不支持在Today屏幕中添加图标。这甚至是功能文档中提到的第一件事情之一:

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

您可以尝试使用SHNotificationAdd