转载一:http://blog.sina.com.cn/s/blog_6acf36ee0100rxdb.html
转载二:http://blog.csdn.net/akof1314/article/details/5121911
转载三:http://www.xuebuyuan.com/1768243.html
转载四:https://www.codeproject.com/Articles/74/Adding-Icons-to-the-System-Tray
在Duilib的Win32程序中,响应托盘消息在HandleCustomMessage函数中坐处理。
NOTIFYICONDATA m_nid;//托盘 m_nid.cbSize = sizeof(m_nid); m_nid.hWnd = /*this->m_hWnd*/NULL; m_nid.uID = 1000; m_nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP |NIF_INFO; //NIF_INFO这个标识设置才会出气泡 //m_nid.hIcon = sfi.hIcon; m_nid.hIcon = LoadIcon(CPaintManagerUI::GetInstance(),MAKEINTRESOURCE(IDI_ICON)); m_nid.uCallbackMessage = WM_TRAYNOTIFYICON; m_nid.dwInfoFlags=NIIF_ERROR; m_nid.uTimeout = 1000; //StrCpy(m_nid.szTip, _T("佰卓云盾保护你的隐私安全")); StrCpy(m_nid.szInfo, _T("后台监控中..."));//气泡信息 StrCpy(m_nid.szInfoTitle, _T("USB sensor")); ::Shell_NotifyIcon(NIM_ADD, &m_nid);