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); }
原文地址:https://www.cnblogs.com/ahcc08/p/11331045.html
时间: 2024-11-15 00:52:55