Click here to Skip to main content
15,894,546 members
Articles / Desktop Programming / MFC

A Simple Method to Control the Startup State of an MFC SDI Application

Rate me:
Please Sign up or sign in to vote.
4.49/5 (19 votes)
28 Feb 2008CPOL3 min read 75K   594   37  
How to minimize or maximize an SDI application without any flash artifacts.
// MyMFCProgramView.h : interface of the CMyMFCProgramView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MYMFCPROGRAMVIEW_H__40A3C192_9063_42B2_9CBC_04A401454083__INCLUDED_)
#define AFX_MYMFCPROGRAMVIEW_H__40A3C192_9063_42B2_9CBC_04A401454083__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CMyMFCProgramView : public CView
{
protected: // create from serialization only
	CMyMFCProgramView();
	DECLARE_DYNCREATE(CMyMFCProgramView)

// Attributes
public:
	CMyMFCProgramDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMyMFCProgramView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CMyMFCProgramView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CMyMFCProgramView)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in MyMFCProgramView.cpp
inline CMyMFCProgramDoc* CMyMFCProgramView::GetDocument()
   { return (CMyMFCProgramDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MYMFCPROGRAMVIEW_H__40A3C192_9063_42B2_9CBC_04A401454083__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) DreamWorks Animation
United States United States
I started programming a TRS-80 Model I in Junior High School with the goal to write arcade games. Since then, I have had the opportunity to work with a wide variety of technologies and environments ranging from real-time telemetry data systems, state-of-the art animation and rigging software, 3D computer games, non-contact measurement acquisition devices, and digital TV systems. I have worked on everything from low-level device drivers to state of the art GUI apps using C#.

Comments and Discussions