// ===========================================================================
|
// File Splash.h
|
// Desc The interface of the CSplash class
|
// ===========================================================================
|
#ifndef _ABHI_SPLASH_H_
|
#define _ABHI_SPLASH_H_
|
|
#include <afxwin.h>
|
|
#define MAX_SPLASH_SIZE 12
|
|
#ifndef __PNS_SPLASH_ARRAY__
|
#define __PNS_SPLASH_ARRAY__
|
typedef struct _SPLASH_ARRAY {
|
CString strtxt;
|
COLORREF color;
|
}SPLASH_ARRAY, *LSPLASH_ARRAY;
|
#endif
|
|
|
// ===========================================================================
|
// 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 uBitmap, 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 uBitmap);
|
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;
|
|
void SetText(CString strText,COLORREF color);
|
|
void ClearText();
|
|
private:
|
void Init();
|
void OnPaint(HWND hwnd);
|
bool MakeTransparent();
|
HWND RegAndCreateWindow();
|
void FreeResources();
|
|
COLORREF m_colTrans;
|
DWORD m_dwWidth;
|
DWORD m_dwHeight;
|
HBITMAP m_hBitmap;
|
LPCTSTR m_lpszClassName;
|
UINT m_uBitmap;
|
|
SPLASH_ARRAY m_TXTArr[MAX_SPLASH_SIZE];
|
LONG m_TXTCount;
|
};
|
|
|
#endif //_ABHI_SPLASH_H_
|