MFC 任务托盘显示气泡
void CTestDlg::OnClose() { ShowWindow(SW_HIDE); if (!m_bHideNoticeInfo) { ShowBalloonTip(_T("程序已最小化到托盘"), _T(""), 3000, 1); m_bHideNoticeInfo = true; } }
BOOL CTestDlg::ShowBalloonTip(LPCTSTR szMsg, LPCTSTR szTitle, UINT uTimeout, DWORD dwInfoFlags) { m_nId.uTimeout = uTimeout; m_nId.dwInfoFlags = dwInfoFlags; strcpy_s(m_nId.szInfo, sizeof(m_nId.szInfo), szMsg ? szMsg : _T("")); strcpy_s(m_nId.szInfoTitle, sizeof(m_nId.szInfoTitle), szTitle ? szTitle : _T("")); return Shell_NotifyIcon(NIM_MODIFY, &m_nId); }
高山流水,海纳百川!