1 |
/* wptTrayPop.cpp - Alternative status box |
/* wptTrayPop.cpp - Alternative status box |
2 |
* Copyright (C) 2002, 2004 Timo Schulz |
* Copyright (C) 2002, 2004, 2006 Timo Schulz |
3 |
* Copyright (C) 2002 Prasenjeet Dutta. <http://www.chaoszone.org> |
* Copyright (C) 2002 Prasenjeet Dutta |
4 |
* |
* |
5 |
* This file is part of WinPT. |
* This file is part of WinPT. |
6 |
* |
* |
182 |
{ |
{ |
183 |
RECT parent; |
RECT parent; |
184 |
MSG msg; |
MSG msg; |
185 |
HWND hWnd; |
HWND hwnd; |
186 |
UINT_PTR timer; |
UINT_PTR timer; |
187 |
WNDCLASS wClass; |
WNDCLASS wClass; |
188 |
int nWndWidth = PD_TRAYPOP_WIDTH; |
int nWndWidth = PD_TRAYPOP_WIDTH; |
193 |
init_wclass (&wClass, glob_hinst); |
init_wclass (&wClass, glob_hinst); |
194 |
RegisterClass (&wClass); |
RegisterClass (&wClass); |
195 |
|
|
196 |
hWnd = CreateWindowEx (WS_EX_TOOLWINDOW | WS_EX_TOPMOST, |
hwnd = CreateWindowEx (WS_EX_TOOLWINDOW | WS_EX_TOPMOST, |
197 |
PD_WINDOWNAME, PD_WINDOWNAME, |
PD_WINDOWNAME, PD_WINDOWNAME, |
198 |
WS_POPUP, |
WS_POPUP, |
199 |
(parent.right + parent.left) / 2, |
(parent.right + parent.left) / 2, |
200 |
(parent.bottom + parent.top) / 2, |
(parent.bottom + parent.top) / 2, |
201 |
nWndWidth - 2, nWndHeight - 2, |
nWndWidth - 2, nWndHeight - 2, |
202 |
NULL, NULL, glob_hinst, NULL); |
NULL, NULL, glob_hinst, NULL); |
203 |
if (!hWnd) |
if (!hwnd) |
204 |
BUG (NULL); |
BUG (NULL); |
205 |
else { /* Ensure parent never loses focus. */ |
else { /* Ensure parent never loses focus. */ |
206 |
ShowWindow (hWnd, SW_SHOW); |
ShowWindow (hwnd, SW_SHOW); |
207 |
UpdateWindow (hWnd); |
UpdateWindow (hwnd); |
208 |
EnableWindow (hParentWnd, TRUE); |
EnableWindow (hParentWnd, TRUE); |
209 |
center_window (hWnd, hParentWnd); |
center_window (hwnd, hParentWnd); |
210 |
SetActiveWindow (NULL); |
SetActiveWindow (NULL); |
211 |
} |
} |
212 |
|
|
213 |
timer = SetTimer (hWnd, PD_TIMER_IDENTIFIER, millis, |
timer = SetTimer (hwnd, PD_TIMER_IDENTIFIER, millis, |
214 |
(TIMERPROC) popup_timer_proc); |
(TIMERPROC) popup_timer_proc); |
215 |
|
|
216 |
while (GetMessage (&msg, NULL, 0, 0)) { |
while (GetMessage (&msg, NULL, 0, 0)) { |