example1.cpp

来自「基于WINCE」· C++ 代码 · 共 84 行

CPP
84
字号
// example1.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "example1.h"
#include "example1Dlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CExample1App

BEGIN_MESSAGE_MAP(CExample1App, CWinApp)
	//{{AFX_MSG_MAP(CExample1App)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CExample1App construction

CExample1App::CExample1App()
	: CWinApp()
{
    //2006/7/11下面这六句话使程序一运行就将屏幕逆时针旋转90度
	
	DEVMODE DevMode;
	memset(&DevMode, 0, sizeof (DevMode));
    DevMode.dmSize               = sizeof (DevMode);
    DevMode.dmFields             = DM_DISPLAYORIENTATION;
	DevMode.dmDisplayOrientation = DMDO_90;
	ChangeDisplaySettingsEx(NULL, &DevMode, NULL, CDS_RESET, NULL);
	//ChangeDisplaySettingsEx(NULL, &DevMode, NULL, 0, NULL);
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CExample1App object

CExample1App theApp;

/////////////////////////////////////////////////////////////////////////////
// CExample1App initialization

BOOL CExample1App::InitInstance()
{
	AfxEnableControlContainer();

	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.

	CExample1Dlg dlg;
	m_pMainWnd = &dlg;
	//MessageBox(NULL,TEXT("START"),NULL,MB_OK);//先弹出此小对话框,后弹出主对话框
	int nResponse = dlg.DoModal();
	//主对话框退出后才弹出下面的小对话框
	//MessageBox(NULL,TEXT("one"),NULL,MB_OK);
	//Sleep(8000);

	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
		//MessageBox(NULL,TEXT("TWO"),NULL,MB_OK);
		//Sleep(8000);
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
		MessageBox(NULL,TEXT("THREE"),NULL,MB_OK);
	}

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}

⌨️ 快捷键说明

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