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

📄 configxdlgx.cpp

📁 单片机对FLASH芯片的烧写,源程序,原理图,PCB图
💻 CPP
字号:
// ConfigxDlgx.cpp : implementation file
//

#include "stdafx.h"
#include "prg0.h"
#include "ConfigxDlgx.h"
#include "Splashwnd.h"
//#include "ConfigxDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CConfigxDlgx dialog


CConfigxDlgx::CConfigxDlgx(CWnd* pParent /*=NULL*/)
	: CDialog(CConfigxDlgx::IDD, pParent)
{
	//{{AFX_DATA_INIT(CConfigxDlgx)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


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


BEGIN_MESSAGE_MAP(CConfigxDlgx, CDialog)
	//{{AFX_MSG_MAP(CConfigxDlgx)
	ON_WM_CREATE()
	ON_WM_TIMER()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CConfigxDlgx message handlers

int CConfigxDlgx::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if(!wndSplashWnd.Create(this))
	{	AfxMessageBox("程序启动错误!  \n\r程序终止。",MB_OK);
//		EndDialog();
		return FALSE;
	}
	wndSplashWnd.ShowWindow(SW_SHOW);
	wndSplashWnd.UpdateWindow();

	SetTimer(1009, 5000, NULL);

	if (CDialog::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	
	return 0;
}

void CConfigxDlgx::OnTimer(UINT nIDEvent) 
{
	CDialog::OnTimer(nIDEvent);
	if(nIDEvent==1009)
	{
		KillTimer(nIDEvent);
		fstart=1;
		wndSplashWnd.EnableWindow(FALSE);
		CPrg0 dlg;
		dlg.DoModal();
//		CDialog::OnCancel();
		EndDlg();
	}
}

BOOL CConfigxDlgx::PreTranslateMessage(MSG* pMsg) 
{
	if(!fstart)
	{if(pMsg->message == WM_KEYDOWN ||
	    pMsg->message == WM_SYSKEYDOWN ||
	    pMsg->message == WM_LBUTTONDOWN ||
	    pMsg->message == WM_RBUTTONDOWN ||
	    pMsg->message == WM_MBUTTONDOWN ||
	    pMsg->message == WM_NCLBUTTONDOWN ||
	    pMsg->message == WM_NCRBUTTONDOWN ||
	    pMsg->message == WM_NCMBUTTONDOWN)
		SetTimer(1009, 1, NULL);
		return CDialog::PreTranslateMessage(pMsg);
	}
	return CDialog::PreTranslateMessage(pMsg);

}

BOOL CConfigxDlgx::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	fstart=0;
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CConfigxDlgx::OnCancel() 
{

	CDialog::OnCancel();
}

void CConfigxDlgx::EndDlg()
{
	wndSplashWnd.DestroyWindow();
	EndDialog(0);
}

⌨️ 快捷键说明

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