LRESULT CSystemTray::OnTimer(UINT nIDEvent) { if (nIDEvent == m_uIDTimer) { time_t CurrentTime; time(&CurrentTime); time_t period = CurrentTime - m_StartTime; if (m_nAnimationPeriod > 0 && m_nAnimationPeriod < period) { StopAnimation(); return 0L; } StepAnimation(); return 0L; } else if (nIDEvent == m_uIDTimerBallon) { m_tnd.uFlags = NIF_INFO; m_tnd.szInfo[0] = _T('\0'); Shell_NotifyIcon (NIM_MODIFY, &m_tnd); return 0L; } else { ASSERT(FALSE); return 0L; } }
void CSystemTray::OnTimer(UINT nIDEvent) { ASSERT(nIDEvent == m_nIDEvent); COleDateTime CurrentTime = COleDateTime::GetCurrentTime(); COleDateTimeSpan period = CurrentTime - m_StartTime; if (m_nAnimationPeriod > 0 && m_nAnimationPeriod < period.GetTotalSeconds()) { StopAnimation(); return; } StepAnimation(); }
LRESULT CSystemTray::OnTimer(UINT nIDEvent) { if (nIDEvent != m_uIDTimer) { ASSERT(FALSE); return 0L; } time_t CurrentTime; time(&CurrentTime); time_t period = CurrentTime - m_StartTime; if (m_nAnimationPeriod > 0 && m_nAnimationPeriod < period) { StopAnimation(); return 0L; } StepAnimation(); return 0L; }