// GameWnd.cpp : implementation file // #include "game.h" #include "GameWnd.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // GameWnd IMPLEMENT_DYNCREATE(GameWnd, CFrameWnd) GameWnd::GameWnd() { Create(NULL,"´´½¨´°¿Ú"); bitmap=new CBitmap; bitmap->m_hObject=LoadImage(NULL,"1.1.bmp",IMAGE_BITMAP,93,100,LR_LOADFROMFILE); CPaintDC dc(this); mdc=new CDC; mdc->CreateCompatibleDC(&dc); mdc->SelectObject(bitmap); i=0; } GameWnd::~GameWnd() { } BEGIN_MESSAGE_MAP(GameWnd, CFrameWnd) //{{AFX_MSG_MAP(GameWnd) ON_WM_TIMER() ON_WM_CREATE() ON_WM_PAINT() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // GameWnd message handlers void GameWnd::OnTimer(UINT nIDEvent) { // TODO: Add your message handler code here and/or call default OnPaint(); CFrameWnd::OnTimer(nIDEvent); } int GameWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; SetTimer(1,800,NULL); // TODO: Add your specialized creation code here return 0; } void GameWnd::OnPaint() { CClientDC dc(this); // device context for painting // TODO: Add your message handler code here if (i++<300) { dc.BitBlt(0+i,0,93,100,mdc,0,0,SRCCOPY); } else i=0; // Do not call CFrameWnd::OnPaint() for painting messages }