コード例 #1
0
ファイル: WndScheduler.cpp プロジェクト: ivan386/Shareaza
void CSchedulerWnd::OnTimer(UINT_PTR nIDEvent) 
{
	if ( nIDEvent == 1 && IsPartiallyVisible() )
	{
		DWORD tTicks = GetTickCount();
		if ( ( tTicks - tLastUpdate ) > 1000ul )
		{
			Update();
		}
	}
}
コード例 #2
0
ファイル: WndSearch.cpp プロジェクト: qing3962/peerproject
void CSearchWnd::OnTimer(UINT_PTR nIDEvent)
{
    CSearchPtr pManaged;

    CSingleLock pLock( &m_pMatches->m_pSection );
    if ( pLock.Lock( 100 ) )
    {
        if ( ! empty() )
            pManaged = m_oSearches.back();

        if ( pManaged )
        {
            if ( pManaged->IsActive() &&
                    pManaged->m_nQueryCount > m_nMaxQueryCount )
            {
                m_bWaitMore = TRUE;
                pManaged->SetActive( FALSE );
                theApp.Message( MSG_DEBUG, _T("Search Reached Maximum Duration") );
                m_bUpdate = TRUE;
            }
            // We need to keep the lock for now- release after we update the progress panel
        }
        else
        {
            // We don't need to hold the lock
            pLock.Unlock();
        }
    }

    if ( IsPartiallyVisible() && nIDEvent == 1 )
    {
        if ( m_bSetFocus )
        {
            if ( m_bPanel && m_bPaused )
                m_wndPanel.SetSearchFocus();
            else
                m_wndList.SetFocus();
            m_bSetFocus = FALSE;
        }

        //if ( pManaged && ( m_nCacheHubs != pManaged->m_nHubs || m_nCacheLeaves != pManaged->m_nLeaves ) )
        UpdateMessages();
    }

    // Unlock if we were locked
    if ( pManaged )
        pLock.Unlock();

    CBaseMatchWnd::OnTimer( nIDEvent );

    if ( m_pMatches->m_nFilteredHits == 0 )
        m_wndDetails.SetFile( NULL );
}
コード例 #3
0
void CHostCacheWnd::OnTimer(UINT nIDEvent) 
{
	if ( nIDEvent == 1 && IsPartiallyVisible() )
	{
		PROTOCOLID nEffective = m_nMode ? m_nMode : PROTOCOL_G2;

		if ( ( nEffective != PROTOCOL_G1 ) && ( nEffective != PROTOCOL_G2 ) && ( nEffective != PROTOCOL_ED2K ) )
			nEffective = PROTOCOL_G2;

		CHostCacheList* pCache = HostCache.ForProtocol( nEffective );
		DWORD tTicks = GetTickCount();

		// Wait 5 seconds before refreshing; do not force updates
		if ( ( pCache->m_nCookie != m_nCookie ) && ( ( tTicks - tLastUpdate ) > 5000 ) ) Update();
	}
}
コード例 #4
0
ファイル: WndLibrary.cpp プロジェクト: GetEnvy/Envy
void CLibraryWnd::OnTimer(UINT_PTR nIDEvent)
{
	const DWORD tNow = GetTickCount();

	if ( nIDEvent == 1 )
	{
		if ( IsPartiallyVisible() )
		{
			CWaitCursor pCursor;
			m_wndFrame.Update( FALSE );
			m_tLast = tNow;
		}
	}
	else if ( tNow > m_tLast + 30000 )
	{
		m_wndFrame.Update( FALSE );
		m_tLast = tNow;
	}
}