www.pudn.com > HPMapx.rar > BrentSplashEx.cpp


// AntSplash.cpp 
 
#include "stdafx.h" 
#include "BrentSplashEx.h" 
#include "..\resource.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
BEGIN_MESSAGE_MAP(CSplashWindow, CWnd) 
  ON_WM_PAINT() 
END_MESSAGE_MAP() 
 
CSplashWindow::CSplashWindow() 
{ 
	m_Bitmap.LoadBitmap(MAKEINTRESOURCE(IDB_BITMAP_LOGO)); 
	m_Bitmap.GetBitmap(&bmBitmap); 
} 
 
CSplashWindow::~CSplashWindow() 
{ 
} 
 
void CSplashWindow::CreateSplash(LPCTSTR szApp_Staring) 
{ 
	CreateEx(0, 
		     AfxRegisterWndClass( 
			 0, 
			 AfxGetApp()->LoadStandardCursor(IDC_UPARROW)), 
			 szApp_Staring, 
			 WS_POPUP, 
			 0, 
			 0, 
			 bmBitmap.bmWidth,  //Bitmap Width = Splash Window Width 
			 bmBitmap.bmHeight, //Bitmap Height = Splash Window Height 
			 NULL, 
			 NULL, 
			 NULL); 
} 
 
void CSplashWindow::OnPaint() 
{ 
	CPaintDC dc(this); 
	memDC.CreateCompatibleDC(NULL); 
	Old_Bitmap = memDC.SelectObject(&m_Bitmap); 
	dc.StretchBlt(0, 
				  0, 
				  bmBitmap.bmWidth, 
				  bmBitmap.bmHeight,    
				  &memDC,    
				  0, 
				  0, 
				  bmBitmap.bmWidth,     
				  bmBitmap.bmHeight, 
				  SRCCOPY); 
	memDC.SelectObject(Old_Bitmap); 
	memDC.DeleteDC(); 
}