MFC task tray to display a bubble

void CTestDlg :: the OnClose () 
{ 
    the ShowWindow (SW_HIDE); 

    IF (! m_bHideNoticeInfo) 
    { 
        the ShowBalloonTip (_T ( " program minimized to the tray " ), _T ( "" ), 3000 , . 1 ); 
        m_bHideNoticeInfo = to 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);
}

 

Guess you like

Origin www.cnblogs.com/ahcc08/p/11331045.html