30 |
|
|
31 |
#include <windows.h> |
#include <windows.h> |
32 |
|
|
33 |
|
#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 |
175 |
} /* init_wclass */ |
} /* init_wclass */ |
176 |
|
|
177 |
|
|
178 |
|
/* Show the given message in a pop-up window for millis miliseconds. */ |
179 |
int |
int |
180 |
show_msg (HWND hParentWnd, int millis, LPCTSTR string) |
show_msg (HWND hParentWnd, int millis, LPCTSTR string) |
181 |
{ |
{ |
209 |
if (hWnd == NULL) |
if (hWnd == NULL) |
210 |
return 0; |
return 0; |
211 |
else { |
else { |
212 |
ShowWindow(hWnd, SW_SHOW); |
ShowWindow (hWnd, SW_SHOW); |
213 |
UpdateWindow(hWnd); |
UpdateWindow (hWnd); |
214 |
// ensure parent never loses focus |
// ensure parent never loses focus |
215 |
EnableWindow(hParentWnd, TRUE); |
EnableWindow (hParentWnd, TRUE); |
216 |
SetActiveWindow(NULL); |
center_window (hWnd, hParentWnd); |
217 |
|
SetActiveWindow (NULL); |
218 |
} |
} |
219 |
|
|
220 |
timer = SetTimer( |
timer = SetTimer (hWnd, // handle to window |
221 |
hWnd, // handle to window |
PD_TIMER_IDENTIFIER, // timer identifier |
222 |
PD_TIMER_IDENTIFIER, // timer identifier |
millis, // time-out value |
223 |
millis, // time-out value |
(TIMERPROC) popup_timer_proc // timer procedure |
224 |
(TIMERPROC) popup_timer_proc // timer procedure |
); |
225 |
); |
|
226 |
|
while (GetMessage (&msg, NULL, 0, 0)) { |
227 |
while( GetMessage(&msg, NULL, 0, 0) ) { |
TranslateMessage (&msg); |
228 |
TranslateMessage(&msg); |
DispatchMessage (&msg); |
|
DispatchMessage(&msg); |
|
229 |
} |
} |
230 |
|
|
231 |
return msg.wParam; |
return msg.wParam; |
232 |
} /* show_alert */ |
} |