我是新手,我已经为我的应用程序创建了托盘图标跟
void createTrayIcon(LpSTR msg)
{
memset(&m_NID, 0 , sizeof(m_NID));
m_NID.cbSize = sizeof(m_NID);
// set tray icon ID
m_NID.uID = ID_SYSTEMTRAY ;
// set handle to the window that receives tray icon notifications
ASSERT(::IsWindow(GetSafeHwnd()));
m_NID.hWnd = GetSafeHwnd();
// set message that will be sent from tray icon to the window
m_NID.uCallbackMessage = WM_TRAYICON_EVENT;
StringCchCopy(m_NID.szInfo, ARRAYSIZE(m_NID.szTip),msg);
StringCchCopy(m_NID.szInfoTitle, ARRAYSIZE(m_NID.szInfoTitle), L"DuOS");
// fields that are being set when adding tray icon
m_NID.uFlags = NIF_MESSAGE|NIF_ICON|NIF_INFO;
// set image
m_NID.hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
if(!m_NID.hIcon)
return FALSE;
return Shell_NotifyIcon(NIM_ADD, &m_NID);
}
我正在使用显示通知
Shell_NotifyIcon(NIM_MODIFY , &m_NID);
My problem is I want to handle that Notification i.e, If user clicks on that
Notification I need to do some action, How to achieve this
我正在尝试从最近两天开始,我已经谷歌了很多次并搜索了很多博客但我不能,任何人请帮助我
终于得到了答案,
那里有一个NIN_BALOONUSERCLICK标志,如果用户点击 Baloon,它将返回此标志......