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

📄 bootdlg.cpp

📁 太原是公交查询系统(未实现中转)实现了数据库的链接
💻 CPP
字号:
// BootDlg.cpp : implementation file
//

#include "stdafx.h"
#include "TrasQuery.h"
#include "BootDlg.h"
#include "TrasQueryDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBootDlg dialog


CBootDlg::CBootDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CBootDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CBootDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	//m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); 
	m_brush.CreateSolidBrush(RGB(208,214,249));
}


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


BEGIN_MESSAGE_MAP(CBootDlg, CDialog)
	//{{AFX_MSG_MAP(CBootDlg)
	ON_BN_CLICKED(IDR_BOOT_BTN, OnBootBtn)
	ON_WM_CTLCOLOR()
	ON_WM_TIMER()
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBootDlg message handlers

void CBootDlg::OnBootBtn() 
{
	// TODO: Add your control notification handler code here
	CTrasQueryDlg dlg;
	dlg.DoModal();
}

HBRUSH CBootDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
	
	// TODO: Change any attributes of the DC here
	if(pWnd->GetDlgCtrlID()==IDC_WELCOM1 ||
		pWnd->GetDlgCtrlID()==IDC_WELCOM2 ||
		pWnd->GetDlgCtrlID()==IDC_WELCOM3 ||
		pWnd->GetDlgCtrlID()==IDC_WELCOM4 ||
		pWnd->GetDlgCtrlID()==IDC_WELCOM5 ||
		pWnd->GetDlgCtrlID()==IDC_WELCOM6 ||
		pWnd->GetDlgCtrlID()==IDC_WELCOM7 ||
		pWnd->GetDlgCtrlID()==IDC_WELCOM8 ||
		pWnd->GetDlgCtrlID()==IDC_WELCOM9 ||
		pWnd->GetDlgCtrlID()==IDC_WELCOM10 ||
		pWnd->GetDlgCtrlID()==IDC_WELCOM11 ||
		pWnd->GetDlgCtrlID()==IDC_WELCOM12 ||
		pWnd->GetDlgCtrlID()==IDC_WELCOM13)
	{
		pDC->SetBkColor(RGB(255,0,0));
		//pDC->SetTextColor(RGB(255,0,0));
	}
	// TODO: Return a different brush if the default is not desired
	//return hbr;
	return m_brush;
}

BOOL CBootDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_hIcon[0]=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON2));
	m_hIcon[1]=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON11));
	m_hIcon[2]=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON3));
	m_hIcon[3]=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON9));
	m_hIcon[4]=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON5));
	m_hIcon[5]=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON7));
	m_hIcon[6]=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON6));
	m_hIcon[7]=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON8));
	m_hIcon[8]=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON4));
	m_hIcon[9]=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON10));
	m_hIcon[10]=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON1));
	m_hIcon[11]=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON12));
	m_hIcon[12]=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON13));
	SetTimer(1,1200,NULL);
//	SetIcon(m_hIcon, TRUE);			// Set big icon
//	SetIcon(m_hIcon, FALSE);		// Set small
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CBootDlg::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	static int index=0;
    SetClassLong(m_hWnd,GCL_HICON,(LONG)m_hIcon[index]);
	index=++index % 12;
	CDialog::OnTimer(nIDEvent);
}

void CBootDlg::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	// TODO: Add your message handler code here
/*	if (IsIconic())
	{
		CPaintDC dc(this); // device context for painting

		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

		// Center icon in client rectangle
		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;

	//	 Draw the icon
		dc.DrawIcon(x, y, m_hIcon);     //注释原有图标
	}
	else
	{
		CDialog::OnPaint();
	}*/
	// Do not call CDialog::OnPaint() for painting messages
}

⌨️ 快捷键说明

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