00001 // winsplash.h 00002 // 00003 // Copyright (C) 2005, Chris Laurel <claurel@shatters.net> 00004 // 00005 // Win32 splash window 00006 // 00007 // This program is free software; you can redistribute it and/or 00008 // modify it under the terms of the GNU General Public License 00009 // as published by the Free Software Foundation; either version 2 00010 // of the License, or (at your option) any later version. 00011 00012 #include <windows.h> 00013 #include <string> 00014 #include <celengine/image.h> 00015 00016 00017 class SplashWindow 00018 { 00019 public: 00020 SplashWindow(const std::string& _imageFileName); 00021 ~SplashWindow(); 00022 00023 LRESULT CALLBACK windowProc(HWND, UINT uMsg, WPARAM wParam, LPARAM lParam); 00024 void init(); 00025 void paint(HDC hDC); 00026 HWND createWindow(); 00027 int messageLoop(); 00028 void showSplash(); 00029 int close(); 00030 bool createBitmap(); 00031 void updateWindow(); 00032 00033 void setMessage(const std::string& msg); 00034 00035 private: 00036 HWND hwnd; 00037 char* className; 00038 std::string imageFileName; 00039 Image* image; 00040 HBITMAP hBitmap; 00041 HBITMAP hCompositionBitmap; 00042 bool useLayeredWindow; 00043 std::string message; 00044 unsigned int winWidth; 00045 unsigned int winHeight; 00046 };
1.4.1