托盘图标显示

来源:互联网 发布:mac os x 10.8dmg 编辑:程序博客网 时间:2024/05/17 03:02

添加:

NOTIFYICONDATA notifyIcon.hWnd = GetSafeHwnd();    // 窗口句柄
notifyIcon.uCallbackMessage = WM_UM_TRAYNOTIFY;  // 回调事件
notifyIcon.hIcon = m_hIcon;                                                // 显示图标
// Set tray notification tip information
CString strToolTip = _T("xxxx");
_tcsncpy_s(notifyIcon.szTip, strToolTip, strToolTip.GetLength());
::Shell_NotifyIcon(NIM_ADD, notifyIcon);


移除:

notifyIcon.hIcon=NULL;

Shell_NotifyIcon(NIM_DELETE,notifyIcon);

原创粉丝点击