托盘图标显示

xiaoxiao2021-02-28  44

添加:

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);

转载请注明原文地址: https://www.6miu.com/read-79711.html

最新回复(0)