Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Chapter 5: The Document/View Architecture Visual C++ and MFC Fundamentals


MessageBox("This window has been activated, without the mouse!");
break;
case WA_INACTIVE:
MessageBox("This window has been deactivated and cannot be
changed now!!");
break;
case WA_CLICKACTIVE:
MessageBox("This window has been activated using the mouse!!!");
break;
}
}

void CMainFrame::OnPaint()
{
CFrameWnd::OnPaint();

MessageBox("The window has been painted<==>");
}

void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
/* CMainFrame::OnSize(nType, cx, cy);

// TODO: Add your message handler code here
char *MsgToShow = new char[20];
char *MsgCoord = new char[20];

switch(nType)
{
case SIZE_MINIMIZED:
strcpy(MsgToShow, "Minimized ");
break;
case SIZE_MAXIMIZED:
strcpy(MsgToShow, "Maximized ");
break;
case SIZE_RESTORED:
strcpy(MsgToShow, "Restored ");
break;
case SIZE_MAXHIDE:
strcpy(MsgToShow, "Maximized Not Me ");
break;
case SIZE_MAXSHOW:
strcpy(MsgToShow, "Restored Not Me ");
break;
}

sprintf(MsgCoord, "Left = %d | Top = %d", cx, cy);
strcat(MsgToShow, MsgCoord);
MessageBox(MsgToShow);
*/
}

void CMainFrame::OnMove(int x, int y)
{
CFrameWnd::OnMove(x, y);

// TODO: Add your message handler code here
char *MsgCoord = new char[20];
Free download pdf