|
From: EviLToYLeT <evi...@us...> - 2004-08-29 18:59:09
|
Update of /cvsroot/notepro/pete-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15036/src Added Files: splash.cpp splash.h Log Message: --- NEW FILE: splash.cpp --- #include <windows.h> #include "splash.h" CSplash::CSplash(HINSTANCE hInstance){ _hInstance = hInstance; WNDCLASSEX wc; ::ZeroMemory(&wc, sizeof(WNDCLASSEX)); wc.cbClsExtra = 0; wc.cbSize = sizeof(WNDCLASSEX); wc.cbWndExtra = 0; wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); wc.hCursor = NULL; wc.hIcon = NULL; wc.hIconSm = NULL; wc.hInstance = hInstance; wc.lpfnWndProc = SplashWndProc; wc.lpszClassName = szSplashName; wc.lpszMenuName = NULL; wc.style = CS_NOCLOSE; if(!::RegisterClassEx(&wc)){ MessageBox(0,"Could not register splash screen", "Attention", 0); } _hWnd = ::CreateWindow(szSplashName,"PETE", WS_POPUPWINDOW, 500, 300, 300, 400, NULL, NULL, hInstance, NULL); ShowWindow(_hWnd,SW_SHOW); UpdateWindow(_hWnd); } CSplash::~CSplash(){ ::MessageBox(0,"Splash screen was just destructed", "Attention",NULL); ::DestroyWindow(_hWnd); ::UnregisterClass(szSplashName,_hInstance); } LRESULT CALLBACK SplashWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam){ return DefWindowProc(hWnd,msg,wParam,lParam); } --- NEW FILE: splash.h --- #ifndef _SPLASH #define _SPLASH static TCHAR szSplashName[] = "CSplash"; class CSplash{ public: CSplash(HINSTANCE); //Initialize and show the splash screen ~CSplash(); //Kill the splash screen when you're done private: HWND _hWnd; //Handle to our splash window HINSTANCE _hInstance; //Current instance }; LRESULT CALLBACK SplashWndProc(HWND, UINT, WPARAM, LPARAM); //Splash screen window procedure #endif |