0

Iam NewBie,我已经为我的应用程序创建了托盘图标

 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

我从最近两天开始尝试这个我已经谷歌了很多次并搜索了很多博客但我不能,任何人都请帮助我

4

1 回答 1

1

最后我得到了答案

那里有一个NIN_BALOONUSERCLICK标志,如果用户点击 Baloon,它将返回这个标志......

于 2013-11-20T15:08:21.347 回答