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

📄 mainfrm.cpp

📁 《Visual C++数字图像与图形处理》一书中编译通过的图像显示程序
💻 CPP
字号:
// MainFrm.cpp : implementation of the CMainFrame class
//

#include "stdafx.h"
#include "DisplayMode.h"

#include "MainFrm.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMainFrame

IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)

BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
	//{{AFX_MSG_MAP(CMainFrame)
	ON_WM_PALETTECHANGED()
	ON_WM_QUERYNEWPALETTE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction

CMainFrame::CMainFrame()
{
	// TODO: add member initialization code here
	
}

CMainFrame::~CMainFrame()
{
}

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
	if( !CFrameWnd::PreCreateWindow(cs) )
		return FALSE;
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs
	//window style

	cs.style &= ~ FWS_ADDTOTITLE;
	/*
	cs.style &= WS_OVERLAPPED | WS_SYSMENU | WS_BORDER | WS_CAPTION;
	cs.cx = 400;
	cs.cy = 300;
	cs.x = 0;
	cs.y = 0;
	*/
	/*
	//	最大化

	在应用程序类中: 
	m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED );
 
    //全屏

	在框架类中: 
	修改如下: 
  
			m_strTitle = "XXXX";//标题.... 
			// Set the position of the window to the upper -left corner. 
			cs.x =cs. y =0;//屏幕左上角 
			//Set the width and height of the window . 
			cs. cx=GetSystemMetrics (SM_CXSCREEN); 
			cs. cy=GetSystemMetrics (SM_CYSCREEN);//屏幕右下角 
			return CFrameWnd::PreCreateWindow(cs); 


	  */

	return TRUE;
}

/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics

#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
	CFrameWnd::AssertValid();
}

void CMainFrame::Dump(CDumpContext& dc) const
{
	CFrameWnd::Dump(dc);
}

#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers


void CMainFrame::OnPaletteChanged(CWnd* pFocusWnd) 
{
	CFrameWnd::OnPaletteChanged(pFocusWnd);
	
	// TODO: Add your message handler code here
	CView* pView = GetActiveView();
	if(pFocusWnd != pView)
		pView -> Invalidate();
	
}

BOOL CMainFrame::OnQueryNewPalette() 
{
	// TODO: Add your message handler code here and/or call default
	CView* pView = GetActiveView();
	pView->Invalidate();
	return CFrameWnd::OnQueryNewPalette();
}

⌨️ 快捷键说明

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