32 |
|
|
33 |
#include "wptW32API.h" |
#include "wptW32API.h" |
34 |
|
|
35 |
#define PD_WINDOWNAME "ClsTrayPop" |
#define PD_WINDOWNAME "ClsTrayPop" |
36 |
#define PD_TIMER_IDENTIFIER 23 |
#define PD_TIMER_IDENTIFIER 23 |
37 |
#define PD_TIMER_TIMEOUT 1500 |
#define PD_TIMER_TIMEOUT 1500 |
38 |
|
|
39 |
#define PD_TRAYPOP_WIDTH 200 |
/* XXX: use the given text to figure out these params. */ |
40 |
#define PD_TRAYPOP_HEIGHT 80 |
#define PD_TRAYPOP_WIDTH 250 |
41 |
|
#define PD_TRAYPOP_HEIGHT 80 |
42 |
|
|
43 |
extern HINSTANCE glob_hinst; |
extern HINSTANCE glob_hinst; |
44 |
extern HWND glob_hwnd; |
extern HWND glob_hwnd; |
45 |
|
|
46 |
|
|
47 |
static LPCTSTR |
static LPCTSTR |
48 |
store_text( LPCTSTR alert_text ) |
store_text (LPCTSTR alert_text) |
49 |
{ |
{ |
50 |
static LPCTSTR text; |
static LPCTSTR text; |
51 |
|
|
52 |
if( alert_text ) |
if (alert_text) |
53 |
text = alert_text; |
text = alert_text; |
54 |
return text; |
return text; |
55 |
} /* store_text */ |
} /* store_text */ |
201 |
WS_POPUP, // window style |
WS_POPUP, // window style |
202 |
(parent.right + parent.left) / 2, (parent.bottom + parent.top) / 2, |
(parent.right + parent.left) / 2, (parent.bottom + parent.top) / 2, |
203 |
nWndWidth - 2, nWndHeight - 2, // width and height, with corrections |
nWndWidth - 2, nWndHeight - 2, // width and height, with corrections |
204 |
NULL, // parent handle |
NULL, NULL, glob_hinst, NULL); |
205 |
NULL, // menu handle |
|
|
glob_hinst, // instance handle |
|
|
NULL // other parameters |
|
|
); |
|
206 |
|
|
207 |
if (hWnd == NULL) |
if (hWnd == NULL) |
208 |
return 0; |
return 0; |
209 |
else { |
else { |
210 |
ShowWindow (hWnd, SW_SHOW); |
ShowWindow (hWnd, SW_SHOW); |
211 |
UpdateWindow (hWnd); |
UpdateWindow (hWnd); |
215 |
SetActiveWindow (NULL); |
SetActiveWindow (NULL); |
216 |
} |
} |
217 |
|
|
218 |
timer = SetTimer (hWnd, // handle to window |
timer = SetTimer (hWnd, PD_TIMER_IDENTIFIER, millis, |
219 |
PD_TIMER_IDENTIFIER, // timer identifier |
(TIMERPROC) popup_timer_proc); |
|
millis, // time-out value |
|
|
(TIMERPROC) popup_timer_proc // timer procedure |
|
|
); |
|
220 |
|
|
221 |
while (GetMessage (&msg, NULL, 0, 0)) { |
while (GetMessage (&msg, NULL, 0, 0)) { |
222 |
TranslateMessage (&msg); |
TranslateMessage (&msg); |