【问题标题】:How to Handle The Notification (Shell_NotifyIcon) to perform Some action when user clicked on It?当用户单击它时如何处理通知(Shell_NotifyIcon)以执行某些操作?
【发布时间】:2013-11-13 09:22:05
【问题描述】:

我是新手,我为我的应用程序创建了托盘图标 与

 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

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

【问题讨论】:

  • 我终于得到了答案,

标签: notifications tooltip trayicon popup-balloons balloon-tip


【解决方案1】:

我终于知道答案了,

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-03-23
    • 1970-01-01
    • 1970-01-01
    • 2022-01-16
    • 1970-01-01
    • 1970-01-01
    • 2020-07-13
    相关资源
    最近更新 更多