blob: 494f0b6f2f6fb5bd5b6e840ac897feb599762396 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
// ===========================================================================
// File Splash.h
// Desc The interface of the CSplash class
// ===========================================================================
#ifndef _ABHI_SPLASH_H_
#define _ABHI_SPLASH_H_
#include "windows.h"
// ===========================================================================
// Class CSplash
// Desc Use it for displaying splash screen for applications
// Works only on Win2000 , WinXP and later versions of Windows
// ===========================================================================
class CSplash
{
public:
// =======================================================================
// Func CSplash
// Desc Default constructor
// =======================================================================
CSplash();
// =======================================================================
// Func CSplash
// Desc Constructor
// Arg Path of the Bitmap that will be show on the splash screen
// Arg The color on the bitmap that will be made transparent
// =======================================================================
CSplash(UINT id, COLORREF colTrans);
// =======================================================================
// Func ~CSplash
// Desc Desctructor
// =======================================================================
virtual ~CSplash();
// =======================================================================
// Func ShowSplash
// Desc Launches the non-modal splash screen
// Ret void
// =======================================================================
void ShowSplash();
// =======================================================================
// Func DoLoop
// Desc Launched the splash screen as a modal window. Not completely
// implemented.
// Ret int
// =======================================================================
int DoLoop();
// =======================================================================
// Func CloseSplash
// Desc Closes the splash screen started with ShowSplash
// Ret int
// =======================================================================
int CloseSplash();
// =======================================================================
// Func SetBitmap
// Desc Call this with the path of the bitmap. Not required to be used
// when the construcutor with the image path has been used.
// Ret 1 if succesfull
// Arg Either the file path or the handle to an already loaded bitmap
// =======================================================================
DWORD SetBitmap(UINT id);
DWORD SetBitmap(HBITMAP hBitmap);
// =======================================================================
// Func SetTransparentColor
// Desc This is used to make one of the color transparent
// Ret 1 if succesfull
// Arg The colors RGB value. Not required if the color is specified
// using the constructor
// =======================================================================
bool SetTransparentColor(COLORREF col);
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
HWND m_hwnd;
private:
void Init();
void OnPaint(HWND hwnd);
bool MakeTransparent();
HWND RegAndCreateWindow();
COLORREF m_colTrans;
DWORD m_dwWidth;
DWORD m_dwHeight;
void FreeResources();
HBITMAP m_hBitmap;
LPCTSTR m_lpszClassName;
};
#endif //_ABHI_SPLASH_H_
|