myscreensvr.cpp

来自「"Visual C++.net实践与提高-深入Windows编程"的源代码」· C++ 代码 · 共 68 行

CPP
68
字号
// MyScreenSvr.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "MyScreenSvr.h"
#include "MyScreenSvrDlg.h"
#include "MyScreenSvrWnd.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMyScreenSvrApp

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

/////////////////////////////////////////////////////////////////////////////
// CMyScreenSvrApp construction

CMyScreenSvrApp::CMyScreenSvrApp(void)
{
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CMyScreenSvrApp object

CMyScreenSvrApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CMyScreenSvrApp initialization

BOOL CMyScreenSvrApp::InitInstance()
{
	return CScreenSvrApp::InitInstance() ;
}

BOOL CMyScreenSvrApp::OpenConfigWnd(HWND hParentWnd)
{
	CWnd *pWndParent = CWnd::FromHandle(hParentWnd);
	CMyScreenSvrDlg dlg(pWndParent);
//	m_pMainWnd = &dlg;  // 删除本句,则设置对话框置于它的父窗口之上.
	int nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
	}
	return FALSE ;			// Exit Appliction: FALSE; True: enter messages Processing
}

BOOL CMyScreenSvrApp::OpenScreenSvrWnd(HWND hParentWnd)
{
	CWnd *pWndParent = CWnd::FromHandle(hParentWnd);
	CMyScreenSvrWnd * pSCRWnd = new CMyScreenSvrWnd(pWndParent) ;
	pSCRWnd->Create();
	m_pMainWnd = pSCRWnd;
	return TRUE ;
}

⌨️ 快捷键说明

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