www.pudn.com > Bluetooth_config_2_0_X.zip > SearchProgDlg.cpp, change:2003-11-14,size:2553b


// SearchProgDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "BprConfig.h" 
#include "SearchProgDlg.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// definition of my global constants & variables 
 
void CALLBACK TimerProc(HWND hWnd, UINT nMsg, UINT nIDEvent, DWORD dwTime); 
 
///////////////////////////////////////////////////////////////////////////// 
// CSearchProgDlg dialog 
 
 
CSearchProgDlg::CSearchProgDlg(CWnd* pParent /*=NULL*/) 
	: CDialog(CSearchProgDlg::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CSearchProgDlg) 
		// NOTE: the ClassWizard will add member initialization here 
	//}}AFX_DATA_INIT 
} 
 
 
void CSearchProgDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CSearchProgDlg) 
	DDX_Control(pDX, IDC_SEARCH_PROGRESS, m_search_progress); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CSearchProgDlg, CDialog) 
	//{{AFX_MSG_MAP(CSearchProgDlg) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CSearchProgDlg message handlers 
 
BOOL CSearchProgDlg::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
	 
	// TODO: Add extra initialization here 
 
    m_search_progress.SetRange(0, 40); 
    m_search_progress.SetStep(1); 
    SetTimer(1, 1500, TimerProc);			// 1100, 2003.11.14 kjw	 
 
    return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
} 
 
void CALLBACK 
TimerProc(HWND hWnd, UINT nMsg, UINT nIDEvent, DWORD dwTime) 
{ 
    switch (nMsg) { 
    case WM_TIMER: 
        ::PostMessage(hWnd, nMsg, 0, 0); 
        break; 
    } 
} 
 
LRESULT CSearchProgDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)  
{ 
	// TODO: Add your specialized code here and/or call the base class 
 
    switch (message) { 
    case WM_TIMER: 
        if (m_search_progress.GetPos()  40) { 
            m_search_progress.StepIt(); 
            SetTimer(1, 1500, TimerProc);	// 1100, 2003.11.14 kjw 
        } 
        else { 
            CDialog::OnCancel(); 
        } 
        break; 
 
    case WM_CLOSE: 
        while (m_search_progress.GetPos()  40) { 
            m_search_progress.StepIt(); 
            Sleep(50); 
        } 
        CDialog::OnOK(); 
        break; 
 
    default: 
        return CDialog::WindowProc(message, wParam, lParam); 
    } 
	 
	return TRUE; 
}