Пример #1
0
void CMainDlg::RollTheTip()
{
	static int nPos = 0;

	SetItemIntAttribute(IDC_LOADING_TIP_ICO, "sub", (nPos)%8);
	nPos++;
}
Пример #2
0
void CMainWnd::OnDec()
{
	m_nCurProgress -= 10;
	if( m_nCurProgress<0 )
		m_nCurProgress = 100;
	SetItemIntAttribute( 8, "value", m_nCurProgress );
}
Пример #3
0
void CMainWnd::OnTimer(UINT_PTR nIDEvent)
{
    static int nFrame = 0;
    SetItemIntAttribute( 11, "sub", nFrame++);
    if (nFrame > 5)
        nFrame = 0;
}
Пример #4
0
void CMainWnd::OnAdd()
{
	m_nCurProgress += 10;
	if( m_nCurProgress>100 )
		m_nCurProgress = 0;
	SetItemIntAttribute( 8, "value", m_nCurProgress );

}
LRESULT CBeikeSafeInstallKavEngineDlg::OnAppInstallProgress(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    int nProgress = 0;

    BOOL bStepChanged = (wParam != m_nCurrentStep);

    switch (wParam)
    {
    case StepDownload:
        nProgress = lParam * 4 / 10;
    	break;
    case StepInstall:
        nProgress = 40 + lParam / 20;
        if (bStepChanged)
        {
            SetItemText(IDC_LBL_PROGRESS, BkString::Get(IDS_VIRSCAN_2577));
        }
        break;
    case StepCheckUpdate:
        nProgress = 45;
        if (bStepChanged)
        {
            m_wndListProgress.AddItem(m_wndListProgress.GetItemCount(), 0, BkString::Get(IDS_VIRSCAN_2578), 2);
            m_wndListProgress.AddItem(m_wndListProgress.GetItemCount(), 0, BkString::Get(IDS_VIRSCAN_2579), 4);
            SetItemText(IDC_LBL_PROGRESS, BkString::Get(IDS_VIRSCAN_2580));
        }
        break;
    case StepUpdate:
        nProgress = 50 + lParam / 2;
        if (bStepChanged)
        {
            m_wndListProgress.DeleteItem(m_wndListProgress.GetItemCount() - 1);
            m_wndListProgress.AddItem(m_wndListProgress.GetItemCount(), 0, BkString::Get(IDS_VIRSCAN_2581), 4);
            SetItemText(IDC_LBL_PROGRESS, BkString::Get(IDS_VIRSCAN_2582));
        }
        if (-1 == lParam)
        {
            m_wndListProgress.DeleteItem(m_wndListProgress.GetItemCount() - 1);
            m_wndListProgress.AddItem(m_wndListProgress.GetItemCount(), 0, BkString::Get(IDS_VIRSCAN_2583), 2);
        }
        else if (100 == lParam)
        {
            m_wndListProgress.DeleteItem(2);
            m_wndListProgress.AddItem(2, 0, BkString::Get(IDS_VIRSCAN_2584), 2);
        }
        break;
    case StepFinish:
        if (bStepChanged)
        {
            int nItem = 0;
            BOOL bFailed = FALSE;

            switch (lParam)
            {
            case 1:
                if (0 == m_nUpdatingFileItem)
                {
                    if (StepDownload == m_nCurrentStep)
                    {
                        m_wndListProgress.SetItemText(0, 0, BkString::Get(IDS_VIRSCAN_2585));
                        m_wndListProgress.SetItemText(0, 1, BkString::Get(IDS_VIRSCAN_2586));
                        m_wndListProgress.SetItem(0, 0, LVIF_IMAGE, NULL, 0, 0, 0, 0);
                    }
                }
                else
                {
                    while (m_nUpdatingFileItem < m_wndListProgress.GetItemCount())
                    {
                        m_wndListProgress.SetItemText(m_nUpdatingFileItem, 1, BkString::Get(IDS_VIRSCAN_2586));
                        m_wndListProgress.SetItem(m_nUpdatingFileItem, 0, LVIF_IMAGE, NULL, 0, 0, 0, 0);
                        m_nUpdatingFileItem ++;
                    }
                }
                nItem = m_wndListProgress.AddItem(m_wndListProgress.GetItemCount(), 0, BkString::Get(IDS_VIRSCAN_2587), 0);
                SetItemText(IDC_LBL_PROGRESS, BkString::Get(IDS_VIRSCAN_2587));
                break;

            case 2: // ÏÂÔØʧ°Ü
                m_wndListProgress.SetItemText(0, 0, BkString::Get(IDS_VIRSCAN_2588));
                m_wndListProgress.SetItemText(0, 1, L"");
                m_wndListProgress.SetItem(0, 0, LVIF_IMAGE, NULL, 9, 0, 0, 0);
                bFailed = TRUE;
                break;
            case 3: // °²×°Ê§°Ü
                m_wndListProgress.SetItemText(1, 0, BkString::Get(IDS_VIRSCAN_2589));
                m_wndListProgress.SetItemText(1, 1, L"");
                m_wndListProgress.SetItem(0, 0, LVIF_IMAGE, NULL, 9, 0, 0, 0);
                bFailed = TRUE;
                break;
            case 4: // Éý¼¶Ê§°Ü
                m_wndListProgress.SetItemText(2, 0, BkString::Get(IDS_VIRSCAN_2590));
                m_wndListProgress.SetItemText(2, 1, L"");
                m_wndListProgress.SetItem(2, 0, LVIF_IMAGE, NULL, 9, 0, 0, 0);

                if (0 != m_nUpdatingFileItem)
                {
                    for (; m_nUpdatingFileItem < m_wndListProgress.GetItemCount(); m_nUpdatingFileItem ++)
                    {
                        m_wndListProgress.SetItemText(m_nUpdatingFileItem, 1, BkString::Get(IDS_VIRSCAN_2591));
                        m_wndListProgress.SetItem(m_nUpdatingFileItem, 0, LVIF_IMAGE, NULL, 9, 0, 0, 0);
                    }
                }
            case 0: // ³É¹¦
                KavEngine::Enable(TRUE);

                nItem = m_wndListProgress.AddItem(m_wndListProgress.GetItemCount(), 0, BkString::Get(IDS_VIRSCAN_2592), 2);
                SetItemText(IDC_LBL_PROGRESS, BkString::Get(IDS_VIRSCAN_2592));
                break;
            }

            if (bFailed)
            {
                nItem = m_wndListProgress.AddItem(m_wndListProgress.GetItemCount(), 0, BkString::Get(IDS_VIRSCAN_2593), 9);
                SetItemText(IDC_LBL_PROGRESS, BkString::Get(IDS_VIRSCAN_2593));
            }

            nProgress = 100;

            {
                KavEngine::UnregisterInstalling(m_hMutex);
                BeikeSafe::Navigate(BKSFNS_MAKE(BKSFNS_UI, BKSFNS_AVE_INSTALL_FINISH));
            }

            m_wndListProgress.EnsureVisible(nItem, TRUE);

            SetItemVisible(IDC_DIV_INSAVE_WORKING, FALSE);
            SetItemVisible(IDC_DIV_INSAVE_FINISH, TRUE);

            if (NULL == ::GetActiveWindow())
                FlashWindow(TRUE);
        }
        break;
    }

    m_nCurrentStep = wParam;

    if (m_nProgress < nProgress)
    {
        m_nProgress = nProgress;
        SetItemIntAttribute(IDC_PROGRESS_INSTALL, "value", nProgress);
    }

    return 0;
}