--- /dev/null
+//////////////////////////////////////////////\r
+// MDIChildMax.cpp\r
+// Definitions for the CViewMax and CMDIChildMax classes\r
+\r
+#include "stdafx.h"\r
+#include "MDIChildMax.h"\r
+#include "resource.h"\r
+\r
+\r
+// CViewMax definitions\r
+void CViewMax::OnDraw(CDC* pDC)\r
+{\r
+ //Centre some text in our view window\r
+ CRect rc = GetClientRect();\r
+ pDC->DrawText(_T("Maxed Window"), -1, rc, DT_CENTER|DT_VCENTER|DT_SINGLELINE);\r
+}\r
+\r
+\r
+// CMDIChildMax definitions\r
+CMDIChildMax::CMDIChildMax()\r
+{\r
+ HINSTANCE hResource = GetApp()->GetResourceHandle();\r
+ HMENU hChildMenu = LoadMenu(hResource, _T("MdiMenuMax"));\r
+ SetHandles(hChildMenu, NULL);\r
+ SetView(m_MaxView);\r
+}\r
+\r
+CMDIChildMax::~CMDIChildMax()\r
+{\r
+}\r
+\r
+void CMDIChildMax::OnInitialUpdate()\r
+{\r
+ SetWindowText(_T("Maximised Window"));\r
+ SetIconLarge(IDI_MAX);\r
+ SetIconSmall(IDI_MAX);\r
+}\r
+\r
+void CMDIChildMax::PreCreate(CREATESTRUCT &cs)\r
+{\r
+ cs.style = WS_MAXIMIZE;\r
+}\r
+\r
+LRESULT CMDIChildMax::WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam)\r
+{\r
+ switch (uMsg)\r
+ {\r
+ case WM_SIZE:\r
+ Invalidate();\r
+ break; // Continue with default processing\r
+\r
+ }\r
+ return WndProcDefault(uMsg, wParam, lParam);\r
+}\r