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

📄 bbbdlg.cpp

📁 wince5.0 下
💻 CPP
字号:
// bbbDlg.cpp : implementation file
//

#include "stdafx.h"
#include "bbb.h"
#include "bbbDlg.h"

#include "dbt.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBbbDlg dialog

CBbbDlg::CBbbDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CBbbDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CBbbDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CBbbDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CBbbDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CBbbDlg, CDialog)
	//{{AFX_MSG_MAP(CBbbDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBbbDlg message handlers

BOOL CBbbDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	CenterWindow(GetDesktopWindow());	// center to the hpc screen


	return TRUE;  // return TRUE  unless you set the focus to a control
}

//#define WM_DEVICECHANGE  0x0219

LRESULT CBbbDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) 
{
	// TODO: Add your specialized code here and/or call the base class
	if (message == WM_DEVICECHANGE)
	{
		DEV_BROADCAST_HDR* dhr = (DEV_BROADCAST_HDR *)lParam; 
		PDEV_BROADCAST_PORT lpdbp = (PDEV_BROADCAST_PORT)dhr; 
		if (wParam == DBT_DEVICEARRIVAL)
			{
//				if (dhr->dbch_devicetype == DBT_DEVTYP_PORT)
				SetWindowText(lpdbp->dbcp_name);
			}
		else
		if (wParam == DBT_DEVICEREMOVECOMPLETE)
		{
			SetWindowText(_T("DBT_DEVICEREMOVECOMPLETE"));
		}else
		{
			CString str ;
			str.Format(TEXT("%x"),lParam);
		SetWindowText(str);
			
		}
	}
	else
	{
		//SetWindowText(_T(""));
	}
	return CDialog::WindowProc(message, wParam, lParam);
}

⌨️ 快捷键说明

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