firstscreen_wnd.cpp

来自「wince下交警执法程序源码,使用evc编写」· C++ 代码 · 共 96 行

CPP
96
字号
// FirstScreen_Wnd.cpp : implementation file
//

#include "stdafx.h"
#include "TrafficExecLaw.h"
#include "FirstScreen_Wnd.h"

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

/////////////////////////////////////////////////////////////////////////////
// CFirstScreen_Wnd

CFirstScreen_Wnd::CFirstScreen_Wnd()
{
	hdc=NULL;
}

CFirstScreen_Wnd::~CFirstScreen_Wnd()
{
}


BEGIN_MESSAGE_MAP(CFirstScreen_Wnd, CWnd)
	//{{AFX_MSG_MAP(CFirstScreen_Wnd)
	ON_WM_PAINT()
	ON_WM_CREATE()
	ON_WM_TIMER()
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CFirstScreen_Wnd message handlers

BOOL CFirstScreen_Wnd::Create(int x,int y,int w,int h) 
{
	// TODO: Add your specialized code here and/or call the base class
    LPCTSTR  lpszClass = AfxRegisterWndClass( CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS, 
		NULL, HBRUSH(COLOR_WINDOW+1), NULL);

	return CWnd::CreateEx(WS_EX_TOPMOST,lpszClass,NULL,WS_VISIBLE|WS_BORDER,
		                  x,y,w,h,NULL,NULL);
}
extern CTrafficExecLawApp theApp;

void CFirstScreen_Wnd::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	if(hdc==NULL)
	{
		
		hBmp=::LoadBitmap (theApp.m_hInstance,MAKEINTRESOURCE(IDB_BITMAP_FIRST_SCRN));
	    hdc=::CreateCompatibleDC (dc.m_hDC);
	    ::SelectObject (hdc,hBmp);
	}

	::BitBlt (dc.m_hDC,0,0,240,320,hdc,0,0,SRCCOPY);
	// Do not call CWnd::OnPaint() for painting messages
}


int CFirstScreen_Wnd::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	this->SetTimer (1,1000,NULL);
	// TODO: Add your specialized creation code here
	return 0;
}

void CFirstScreen_Wnd::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	this->PostMessage (WM_QUIT);
	CWnd::OnTimer(nIDEvent);
}

void CFirstScreen_Wnd::OnDestroy() 
{
	CWnd::OnDestroy();
	
	// TODO: Add your message handler code here
	if(this->hdc)
	{
		::DeleteDC (hdc);
		::DeleteObject (hBmp);
	}
}

⌨️ 快捷键说明

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