⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 searchprogdlg.cpp

📁 Bluetooth 2.0 虚拟成串口 设置代码对蓝牙虚拟串口的设备编写程序有很大的帮助
💻 CPP
字号:
// 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;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -