用Shell_NotifyIcon(NIM_MODIFY,&nid)的问题?
如下函数:
void Shell_NotifyIconTest()
{
NOTIFYICONDATA nid = {0};
nid.cbSize = sizeof(nid);
nid.uID = IDI_ICON_IDLE;
nid.uCallbackMessage = WM_TRAY; // 我已经在OnTray()中做了消息处理(使用窗口最大化)
nid.uFlags = NIF_ICON | NIF_MESSAGE;
nid.hIcon = AfxGetApp()->LoadIcon(IDI_ICON_IDLE); //这个icon和uID一样的没关系吧?
// Add the notification to the tray.
Shell_NotifyIcon(NIM_ADD, &nid); //调用这个之后WM_TRAY正常响应
// Update the notification icon.
nid.uFlags = NIF_ICON;
nid.hIcon = AfxGetApp()->LoadIcon(IDI_ICON_BUSY);
Shell_NotifyIcon(NIM_MODIFY, &nid);//调用了这个之后,图标是改变了,但是不能响应WM_TRAY消息,不知是怎么回事?
return;
}