// SplashWnd.cpp : インプリメンテーション ファイル // #include "stdafx.h" #include "SplashApp.h" #include "SplashWnd.h" #include "resource.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CSplashWnd CSplashWnd::CSplashWnd() { } CSplashWnd::~CSplashWnd() { } BEGIN_MESSAGE_MAP(CSplashWnd, CWnd) //{{AFX_MSG_MAP(CSplashWnd) ON_WM_CREATE() ON_WM_PAINT() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CSplashWnd メッセージ ハンドラ #define SPLASH_CX 400 #define SPLASH_CY 208 BOOL CSplashWnd::Create() { CString strWndClass = AfxRegisterWndClass(0, AfxGetApp()->LoadStandardCursor(IDC_WAIT)); return CreateEx(0, strWndClass, NULL, WS_POPUP | WS_VISIBLE, 0, 0, SPLASH_CX, SPLASH_CY, NULL, NULL); } int CSplashWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CWnd::OnCreate(lpCreateStruct) == -1) return -1; CenterWindow(); SetForegroundWindow(); return 0; } void CSplashWnd::PostNcDestroy() { delete this; } void CSplashWnd::OnPaint() { CPaintDC dc(this); dc.FillSolidRect(0,0,0,0,RGB(200,255,255)); CBitmap bmp; bmp.LoadBitmap(IDB_BITMAP1); dc.DrawState(CPoint(0,0), CSize(SPLASH_CX, SPLASH_CY), &bmp, DST_BITMAP); }