3 /////////////////////////////////////////////////////////////////////////////
5 // Copyright (c) 2002 David Ward
7 /////////////////////////////////////////////////////////////////////////////
11 #include "SplashScreen.h"
13 // Track memory leaks on Windows to the line that new'd the memory
16 #define DEBUG_NEW new( _NORMAL_BLOCK, THIS_FILE, __LINE__ )
19 static char THIS_FILE
[] = __FILE__
;
23 /////////////////////////////////////////////////////////////////////////////
25 LRESULT
CSplash::WndProc(HWND Window
, UINT message
, WPARAM wParam
, LPARAM lParam
) {
26 return TmpWndProc(Window
, message
, wParam
, lParam
);
29 LRESULT CALLBACK
CSplash::TmpWndProc(HWND Window
, UINT message
, WPARAM wParam
, LPARAM lParam
) {
38 hdc
= BeginPaint(Window
, &ps
);
40 GetClientRect(Window
, &rt
);
41 FillRect(hdc
, &rt
, (HBRUSH
) GetStockObject(WHITE_BRUSH
));
42 DrawText(hdc
, TEXT("Dasher Initializing - Please Wait"), -1, &rt
, DT_VCENTER
| DT_CENTER
| DT_SINGLELINE
);
43 EndPaint(Window
, &ps
);
47 // Center & size window
51 MoveWindow(Window
, GetSystemMetrics(SM_CXSCREEN
) / 2 - Width
/ 2, GetSystemMetrics(SM_CYSCREEN
) / 2 - Height
/ 2, Width
, Height
, TRUE
);
55 SendMessage(Window
, WM_CLOSE
, 0, 0);
58 return DefWindowProc(Window
, message
, wParam
, lParam
);
61 CSplash::CSplash(HWND Parent
) {
65 memset(&wndclass
, 0, sizeof(WNDCLASS
));
68 memset(&wndclass
, 0, sizeof(WNDCLASSEX
));
69 wndclass
.cbSize
= sizeof(wndclass
);
72 wndclass
.lpfnWndProc
= TmpWndProc
;
73 wndclass
.hInstance
= WinHelper::hInstApp
;
74 wndclass
.hbrBackground
= (HBRUSH
) GetStockObject(NULL_BRUSH
);
75 wndclass
.lpszClassName
= TEXT("Splash");
78 RegisterClass(&wndclass
);
79 m_hwnd
= CreateWindowEx(WS_EX_TOPMOST
| WS_EX_TOOLWINDOW
, TEXT("Splash"), TEXT("Splash"), WS_POPUP
| WS_VISIBLE
, 0, 0, 0, 0, Parent
, NULL
, WinHelper::hInstApp
, NULL
);
82 RegisterClassEx(&wndclass
);
83 m_hwnd
= CreateWindowEx(WS_EX_TOPMOST
| WS_EX_TOOLWINDOW
, TEXT("Splash"), TEXT("Splash"), WS_POPUP
| WS_VISIBLE
, 0, 0, 0, 0, Parent
, NULL
, WinHelper::hInstApp
, NULL
);
87 WinWrapMap::add(m_hwnd
, this);