4 * Copyright 1997, 2002 Dimitrie O. Paun
5 * Copyright 1998, 1999 Eric Kohl
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 * This code was audited for completeness against the documented features
24 * of Comctl32.dll version 6.0 on Sep. 9, 2002, by Dimitrie O. Paun.
26 * Unless otherwise noted, we believe this code to be complete, as per
27 * the specification mentioned above.
28 * If you discover missing features, or bugs, please note them below.
33 * -- PBS_SMOOTHREVERSE
39 WINE_DEFAULT_DEBUG_CHANNEL(progress
);
43 HWND Self
; /* The window handle for this control */
44 INT CurVal
; /* Current progress value */
45 INT MinVal
; /* Minimum progress value */
46 INT MaxVal
; /* Maximum progress value */
47 INT Step
; /* Step to use on PMB_STEPIT */
48 INT MarqueePos
; /* Marquee animation position */
49 BOOL Marquee
; /* Whether the marquee animation is enabled */
50 COLORREF ColorBar
; /* Bar color */
51 COLORREF ColorBk
; /* Background color */
52 HFONT Font
; /* Handle to font (not unused) */
55 /* Control configuration constants */
58 #define MARQUEE_LEDS 5
59 #define ID_MARQUEE_TIMER 1
61 /* Helper to obtain size of a progress bar chunk ("led"). */
62 static inline int get_led_size ( const PROGRESS_INFO
*infoPtr
, LONG style
,
65 HTHEME theme
= GetWindowTheme (infoPtr
->Self
);
69 if (SUCCEEDED( GetThemeInt( theme
, 0, 0, TMT_PROGRESSCHUNKSIZE
, &chunkSize
)))
73 if (style
& PBS_VERTICAL
)
74 return MulDiv (rect
->right
- rect
->left
, 2, 3);
76 return MulDiv (rect
->bottom
- rect
->top
, 2, 3);
79 /* Helper to obtain gap between progress bar chunks */
80 static inline int get_led_gap ( const PROGRESS_INFO
*infoPtr
)
82 HTHEME theme
= GetWindowTheme (infoPtr
->Self
);
86 if (SUCCEEDED( GetThemeInt( theme
, 0, 0, TMT_PROGRESSSPACESIZE
, &spaceSize
)))
93 /* Get client rect. Takes into account that theming needs no adjustment. */
94 static inline void get_client_rect (HWND hwnd
, RECT
* rect
)
96 HTHEME theme
= GetWindowTheme (hwnd
);
97 GetClientRect (hwnd
, rect
);
99 InflateRect(rect
, -1, -1);
102 DWORD dwStyle
= GetWindowLongW (hwnd
, GWL_STYLE
);
103 int part
= (dwStyle
& PBS_VERTICAL
) ? PP_BARVERT
: PP_BAR
;
104 GetThemeBackgroundContentRect (theme
, 0, part
, 0, rect
, rect
);
108 /* Compute the extend of the bar */
109 static inline int get_bar_size( LONG style
, const RECT
* rect
)
111 if (style
& PBS_VERTICAL
)
112 return rect
->bottom
- rect
->top
;
114 return rect
->right
- rect
->left
;
117 /* Compute the pixel position of a progress value */
118 static inline int get_bar_position( const PROGRESS_INFO
*infoPtr
, LONG style
,
119 const RECT
* rect
, INT value
)
121 return MulDiv (value
- infoPtr
->MinVal
, get_bar_size (style
, rect
),
122 infoPtr
->MaxVal
- infoPtr
->MinVal
);
125 /***********************************************************************
126 * PROGRESS_Invalidate
128 * Don't be too clever about invalidating the progress bar.
129 * InstallShield depends on this simple behaviour.
131 static void PROGRESS_Invalidate( const PROGRESS_INFO
*infoPtr
, INT old
, INT
new )
133 InvalidateRect( infoPtr
->Self
, NULL
, old
> new );
136 /* Information for a progress bar drawing helper */
137 typedef struct tagProgressDrawInfo
148 typedef void (*ProgressDrawProc
)(const ProgressDrawInfo
* di
, int start
, int end
);
150 /* draw solid horizontal bar from 'start' to 'end' */
151 static void draw_solid_bar_H (const ProgressDrawInfo
* di
, int start
, int end
)
154 r
.left
= di
->rect
.left
+ start
;
155 r
.top
= di
->rect
.top
;
156 r
.right
= di
->rect
.left
+ end
;
157 r
.bottom
= di
->rect
.bottom
;
158 FillRect (di
->hdc
, &r
, di
->hbrBar
);
161 /* draw solid horizontal background from 'start' to 'end' */
162 static void draw_solid_bkg_H (const ProgressDrawInfo
* di
, int start
, int end
)
165 r
.left
= di
->rect
.left
+ start
;
166 r
.top
= di
->rect
.top
;
167 r
.right
= di
->rect
.left
+ end
;
168 r
.bottom
= di
->rect
.bottom
;
169 FillRect (di
->hdc
, &r
, di
->hbrBk
);
172 /* draw solid vertical bar from 'start' to 'end' */
173 static void draw_solid_bar_V (const ProgressDrawInfo
* di
, int start
, int end
)
176 r
.left
= di
->rect
.left
;
177 r
.top
= di
->rect
.bottom
- end
;
178 r
.right
= di
->rect
.right
;
179 r
.bottom
= di
->rect
.bottom
- start
;
180 FillRect (di
->hdc
, &r
, di
->hbrBar
);
183 /* draw solid vertical background from 'start' to 'end' */
184 static void draw_solid_bkg_V (const ProgressDrawInfo
* di
, int start
, int end
)
187 r
.left
= di
->rect
.left
;
188 r
.top
= di
->rect
.bottom
- end
;
189 r
.right
= di
->rect
.right
;
190 r
.bottom
= di
->rect
.bottom
- start
;
191 FillRect (di
->hdc
, &r
, di
->hbrBk
);
194 /* draw chunky horizontal bar from 'start' to 'end' */
195 static void draw_chunk_bar_H (const ProgressDrawInfo
* di
, int start
, int end
)
198 int right
= di
->rect
.left
+ end
;
199 r
.left
= di
->rect
.left
+ start
;
200 r
.top
= di
->rect
.top
;
201 r
.bottom
= di
->rect
.bottom
;
202 while (r
.left
< right
)
204 r
.right
= min (r
.left
+ di
->ledW
, right
);
205 FillRect (di
->hdc
, &r
, di
->hbrBar
);
207 r
.right
= min (r
.left
+ di
->ledGap
, right
);
208 FillRect (di
->hdc
, &r
, di
->hbrBk
);
213 /* draw chunky vertical bar from 'start' to 'end' */
214 static void draw_chunk_bar_V (const ProgressDrawInfo
* di
, int start
, int end
)
217 int top
= di
->rect
.bottom
- end
;
218 r
.left
= di
->rect
.left
;
219 r
.right
= di
->rect
.right
;
220 r
.bottom
= di
->rect
.bottom
- start
;
221 while (r
.bottom
> top
)
223 r
.top
= max (r
.bottom
- di
->ledW
, top
);
224 FillRect (di
->hdc
, &r
, di
->hbrBar
);
226 r
.top
= max (r
.bottom
- di
->ledGap
, top
);
227 FillRect (di
->hdc
, &r
, di
->hbrBk
);
232 /* drawing functions for "classic" style */
233 static const ProgressDrawProc drawProcClassic
[8] = {
236 draw_solid_bar_H
, draw_solid_bkg_H
,
238 draw_solid_bar_V
, draw_solid_bkg_V
,
241 draw_chunk_bar_H
, draw_solid_bkg_H
,
243 draw_chunk_bar_V
, draw_solid_bkg_V
,
246 /* draw themed horizontal bar from 'start' to 'end' */
247 static void draw_theme_bar_H (const ProgressDrawInfo
* di
, int start
, int end
)
250 r
.left
= di
->rect
.left
+ start
;
251 r
.top
= di
->rect
.top
;
252 r
.bottom
= di
->rect
.bottom
;
253 r
.right
= di
->rect
.left
+ end
;
254 DrawThemeBackground (di
->theme
, di
->hdc
, PP_CHUNK
, 0, &r
, NULL
);
257 /* draw themed vertical bar from 'start' to 'end' */
258 static void draw_theme_bar_V (const ProgressDrawInfo
* di
, int start
, int end
)
261 r
.left
= di
->rect
.left
;
262 r
.right
= di
->rect
.right
;
263 r
.bottom
= di
->rect
.bottom
- start
;
264 r
.top
= di
->rect
.bottom
- end
;
265 DrawThemeBackground (di
->theme
, di
->hdc
, PP_CHUNKVERT
, 0, &r
, NULL
);
268 /* draw themed horizontal background from 'start' to 'end' */
269 static void draw_theme_bkg_H (const ProgressDrawInfo
* di
, int start
, int end
)
272 r
.left
= di
->rect
.left
+ start
;
273 r
.top
= di
->rect
.top
;
274 r
.right
= di
->rect
.left
+ end
;
275 r
.bottom
= di
->rect
.bottom
;
276 DrawThemeBackground (di
->theme
, di
->hdc
, PP_BAR
, 0, &di
->bgRect
, &r
);
279 /* draw themed vertical background from 'start' to 'end' */
280 static void draw_theme_bkg_V (const ProgressDrawInfo
* di
, int start
, int end
)
283 r
.left
= di
->rect
.left
;
284 r
.top
= di
->rect
.bottom
- end
;
285 r
.right
= di
->rect
.right
;
286 r
.bottom
= di
->rect
.bottom
- start
;
287 DrawThemeBackground (di
->theme
, di
->hdc
, PP_BARVERT
, 0, &di
->bgRect
, &r
);
290 /* drawing functions for themed style */
291 static const ProgressDrawProc drawProcThemed
[8] = {
294 draw_theme_bar_H
, draw_theme_bkg_H
,
296 draw_theme_bar_V
, draw_theme_bkg_V
,
299 draw_theme_bar_H
, draw_theme_bkg_H
,
301 draw_theme_bar_V
, draw_theme_bkg_V
,
304 /***********************************************************************
306 * Draws the progress bar.
308 static LRESULT
PROGRESS_Draw (PROGRESS_INFO
*infoPtr
, HDC hdc
)
313 const ProgressDrawProc
* drawProcs
;
314 ProgressDrawInfo pdi
;
316 TRACE("(infoPtr=%p, hdc=%p)\n", infoPtr
, hdc
);
319 pdi
.theme
= GetWindowTheme (infoPtr
->Self
);
321 /* get the required bar brush */
322 if (infoPtr
->ColorBar
== CLR_DEFAULT
)
323 pdi
.hbrBar
= GetSysColorBrush(COLOR_HIGHLIGHT
);
325 pdi
.hbrBar
= CreateSolidBrush (infoPtr
->ColorBar
);
327 if (infoPtr
->ColorBk
== CLR_DEFAULT
)
328 pdi
.hbrBk
= GetSysColorBrush(COLOR_3DFACE
);
330 pdi
.hbrBk
= CreateSolidBrush(infoPtr
->ColorBk
);
332 /* get the window style */
333 dwStyle
= GetWindowLongW (infoPtr
->Self
, GWL_STYLE
);
335 /* get client rectangle */
336 GetClientRect (infoPtr
->Self
, &pdi
.rect
);
338 FrameRect( hdc
, &pdi
.rect
, pdi
.hbrBk
);
339 InflateRect(&pdi
.rect
, -1, -1);
344 int part
= (dwStyle
& PBS_VERTICAL
) ? PP_BARVERT
: PP_BAR
;
346 GetThemeBackgroundContentRect (pdi
.theme
, hdc
, part
, 0, &pdi
.rect
,
349 /* Exclude content rect - content background will be drawn later */
350 ExcludeClipRect (hdc
, cntRect
.left
, cntRect
.top
,
351 cntRect
.right
, cntRect
.bottom
);
352 if (IsThemeBackgroundPartiallyTransparent (pdi
.theme
, part
, 0))
353 DrawThemeParentBackground (infoPtr
->Self
, hdc
, NULL
);
354 DrawThemeBackground (pdi
.theme
, hdc
, part
, 0, &pdi
.rect
, NULL
);
355 SelectClipRgn (hdc
, NULL
);
356 CopyRect (&pdi
.rect
, &cntRect
);
359 /* compute some drawing parameters */
360 barSmooth
= (dwStyle
& PBS_SMOOTH
) && !pdi
.theme
;
361 drawProcs
= &((pdi
.theme
? drawProcThemed
: drawProcClassic
)[(barSmooth
? 0 : 4)
362 + ((dwStyle
& PBS_VERTICAL
) ? 2 : 0)]);
363 barSize
= get_bar_size( dwStyle
, &pdi
.rect
);
366 GetWindowRect( infoPtr
->Self
, &pdi
.bgRect
);
367 MapWindowPoints( infoPtr
->Self
, 0, (POINT
*)&pdi
.bgRect
, 2 );
371 pdi
.ledW
= get_led_size( infoPtr
, dwStyle
, &pdi
.rect
);
372 pdi
.ledGap
= get_led_gap( infoPtr
);
374 if (dwStyle
& PBS_MARQUEE
)
376 const int ledW
= !barSmooth
? (pdi
.ledW
+ pdi
.ledGap
) : 1;
377 const int leds
= (barSize
+ ledW
- 1) / ledW
;
378 const int ledMEnd
= infoPtr
->MarqueePos
+ MARQUEE_LEDS
;
382 /* case 1: the marquee bar extends over the end and wraps around to
384 const int gapStart
= max((ledMEnd
- leds
) * ledW
, 0);
385 const int gapEnd
= min(infoPtr
->MarqueePos
* ledW
, barSize
);
387 drawProcs
[0]( &pdi
, 0, gapStart
);
388 drawProcs
[1]( &pdi
, gapStart
, gapEnd
);
389 drawProcs
[0]( &pdi
, gapEnd
, barSize
);
393 /* case 2: the marquee bar is between start and end */
394 const int barStart
= infoPtr
->MarqueePos
* ledW
;
395 const int barEnd
= min (ledMEnd
* ledW
, barSize
);
397 drawProcs
[1]( &pdi
, 0, barStart
);
398 drawProcs
[0]( &pdi
, barStart
, barEnd
);
399 drawProcs
[1]( &pdi
, barEnd
, barSize
);
404 int barEnd
= get_bar_position( infoPtr
, dwStyle
, &pdi
.rect
,
408 const int ledW
= pdi
.ledW
+ pdi
.ledGap
;
409 barEnd
= min (((barEnd
+ ledW
- 1) / ledW
) * ledW
, barSize
);
411 drawProcs
[0]( &pdi
, 0, barEnd
);
412 drawProcs
[1]( &pdi
, barEnd
, barSize
);
415 /* delete bar brush */
416 if (infoPtr
->ColorBar
!= CLR_DEFAULT
) DeleteObject (pdi
.hbrBar
);
417 if (infoPtr
->ColorBk
!= CLR_DEFAULT
) DeleteObject (pdi
.hbrBk
);
422 /***********************************************************************
424 * Draw the progress bar. The background need not be erased.
425 * If dc!=0, it draws on it
427 static LRESULT
PROGRESS_Paint (PROGRESS_INFO
*infoPtr
, HDC hdc
)
430 if (hdc
) return PROGRESS_Draw (infoPtr
, hdc
);
431 hdc
= BeginPaint (infoPtr
->Self
, &ps
);
432 PROGRESS_Draw (infoPtr
, hdc
);
433 EndPaint (infoPtr
->Self
, &ps
);
438 /***********************************************************************
440 * Handle the marquee timer messages
442 static LRESULT
PROGRESS_Timer (PROGRESS_INFO
*infoPtr
, INT idTimer
)
444 if(idTimer
== ID_MARQUEE_TIMER
)
446 LONG style
= GetWindowLongW (infoPtr
->Self
, GWL_STYLE
);
449 HTHEME theme
= GetWindowTheme (infoPtr
->Self
);
450 BOOL barSmooth
= (style
& PBS_SMOOTH
) && !theme
;
452 get_client_rect (infoPtr
->Self
, &rect
);
455 ledWidth
= get_led_size( infoPtr
, style
, &rect
) +
456 get_led_gap( infoPtr
);
460 leds
= (get_bar_size( style
, &rect
) + ledWidth
- 1) /
463 /* increment the marquee progress */
464 if(++infoPtr
->MarqueePos
>= leds
)
466 infoPtr
->MarqueePos
= 0;
469 InvalidateRect(infoPtr
->Self
, &rect
, FALSE
);
470 UpdateWindow(infoPtr
->Self
);
476 /***********************************************************************
478 * Makes sure the current position (CurVal) is within bounds.
480 static void PROGRESS_CoercePos(PROGRESS_INFO
*infoPtr
)
482 if(infoPtr
->CurVal
< infoPtr
->MinVal
)
483 infoPtr
->CurVal
= infoPtr
->MinVal
;
484 if(infoPtr
->CurVal
> infoPtr
->MaxVal
)
485 infoPtr
->CurVal
= infoPtr
->MaxVal
;
489 /***********************************************************************
491 * Set new Font for progress bar
493 static HFONT
PROGRESS_SetFont (PROGRESS_INFO
*infoPtr
, HFONT hFont
, BOOL bRedraw
)
495 HFONT hOldFont
= infoPtr
->Font
;
496 infoPtr
->Font
= hFont
;
497 /* Since infoPtr->Font is not used, there is no need for repaint */
501 static DWORD
PROGRESS_SetRange (PROGRESS_INFO
*infoPtr
, int low
, int high
)
503 DWORD res
= MAKELONG(LOWORD(infoPtr
->MinVal
), LOWORD(infoPtr
->MaxVal
));
505 /* if nothing changes, simply return */
506 if(infoPtr
->MinVal
== low
&& infoPtr
->MaxVal
== high
) return res
;
508 infoPtr
->MinVal
= low
;
509 infoPtr
->MaxVal
= high
;
510 PROGRESS_CoercePos(infoPtr
);
511 InvalidateRect(infoPtr
->Self
, NULL
, TRUE
);
515 /***********************************************************************
518 static LRESULT WINAPI
ProgressWindowProc(HWND hwnd
, UINT message
,
519 WPARAM wParam
, LPARAM lParam
)
521 PROGRESS_INFO
*infoPtr
;
522 static const WCHAR themeClass
[] = {'P','r','o','g','r','e','s','s',0};
525 TRACE("hwnd=%p msg=%04x wparam=%lx lParam=%lx\n", hwnd
, message
, wParam
, lParam
);
527 infoPtr
= (PROGRESS_INFO
*)GetWindowLongPtrW(hwnd
, 0);
529 if (!infoPtr
&& message
!= WM_CREATE
)
530 return DefWindowProcW( hwnd
, message
, wParam
, lParam
);
535 DWORD dwExStyle
= GetWindowLongW (hwnd
, GWL_EXSTYLE
);
537 theme
= OpenThemeData (hwnd
, themeClass
);
539 dwExStyle
&= ~(WS_EX_CLIENTEDGE
| WS_EX_WINDOWEDGE
);
540 if (!theme
) dwExStyle
|= WS_EX_STATICEDGE
;
541 SetWindowLongW (hwnd
, GWL_EXSTYLE
, dwExStyle
);
542 /* Force recalculation of a non-client area */
543 SetWindowPos(hwnd
, 0, 0, 0, 0, 0,
544 SWP_FRAMECHANGED
| SWP_NOSIZE
| SWP_NOMOVE
| SWP_NOZORDER
| SWP_NOACTIVATE
);
546 /* allocate memory for info struct */
547 infoPtr
= Alloc (sizeof(PROGRESS_INFO
));
548 if (!infoPtr
) return -1;
549 SetWindowLongPtrW (hwnd
, 0, (DWORD_PTR
)infoPtr
);
551 /* initialize the info struct */
552 infoPtr
->Self
= hwnd
;
554 infoPtr
->MaxVal
= 100;
557 infoPtr
->MarqueePos
= 0;
558 infoPtr
->Marquee
= FALSE
;
559 infoPtr
->ColorBar
= CLR_DEFAULT
;
560 infoPtr
->ColorBk
= CLR_DEFAULT
;
563 TRACE("Progress Ctrl creation, hwnd=%p\n", hwnd
);
568 TRACE("Progress Ctrl destruction, hwnd=%p\n", hwnd
);
570 SetWindowLongPtrW(hwnd
, 0, 0);
571 theme
= GetWindowTheme (hwnd
);
572 CloseThemeData (theme
);
579 return (LRESULT
)infoPtr
->Font
;
582 return (LRESULT
)PROGRESS_SetFont(infoPtr
, (HFONT
)wParam
, (BOOL
)lParam
);
586 return PROGRESS_Paint (infoPtr
, (HDC
)wParam
);
589 return PROGRESS_Timer (infoPtr
, (INT
)wParam
);
591 case WM_THEMECHANGED
:
593 DWORD dwExStyle
= GetWindowLongW (hwnd
, GWL_EXSTYLE
);
595 theme
= GetWindowTheme (hwnd
);
596 CloseThemeData (theme
);
597 theme
= OpenThemeData (hwnd
, themeClass
);
599 /* WS_EX_STATICEDGE disappears when the control is themed */
601 dwExStyle
&= ~WS_EX_STATICEDGE
;
603 dwExStyle
|= WS_EX_STATICEDGE
;
604 SetWindowLongW (hwnd
, GWL_EXSTYLE
, dwExStyle
);
606 InvalidateRect (hwnd
, NULL
, FALSE
);
613 oldVal
= infoPtr
->CurVal
;
615 infoPtr
->CurVal
+= (INT
)wParam
;
616 PROGRESS_CoercePos (infoPtr
);
617 TRACE("PBM_DELTAPOS: current pos changed from %d to %d\n", oldVal
, infoPtr
->CurVal
);
618 PROGRESS_Invalidate( infoPtr
, oldVal
, infoPtr
->CurVal
);
619 UpdateWindow( infoPtr
->Self
);
627 oldVal
= infoPtr
->CurVal
;
628 if(oldVal
!= wParam
) {
629 infoPtr
->CurVal
= (INT
)wParam
;
630 PROGRESS_CoercePos(infoPtr
);
631 TRACE("PBM_SETPOS: current pos changed from %d to %d\n", oldVal
, infoPtr
->CurVal
);
632 PROGRESS_Invalidate( infoPtr
, oldVal
, infoPtr
->CurVal
);
633 UpdateWindow( infoPtr
->Self
);
639 return PROGRESS_SetRange (infoPtr
, (int)LOWORD(lParam
), (int)HIWORD(lParam
));
644 oldStep
= infoPtr
->Step
;
645 infoPtr
->Step
= (INT
)wParam
;
650 return infoPtr
->Step
;
655 oldVal
= infoPtr
->CurVal
;
656 infoPtr
->CurVal
+= infoPtr
->Step
;
657 if(infoPtr
->CurVal
> infoPtr
->MaxVal
)
658 infoPtr
->CurVal
= infoPtr
->MinVal
;
659 if(oldVal
!= infoPtr
->CurVal
)
661 TRACE("PBM_STEPIT: current pos changed from %d to %d\n", oldVal
, infoPtr
->CurVal
);
662 PROGRESS_Invalidate( infoPtr
, oldVal
, infoPtr
->CurVal
);
663 UpdateWindow( infoPtr
->Self
);
669 return PROGRESS_SetRange (infoPtr
, (int)wParam
, (int)lParam
);
673 ((PPBRANGE
)lParam
)->iLow
= infoPtr
->MinVal
;
674 ((PPBRANGE
)lParam
)->iHigh
= infoPtr
->MaxVal
;
676 return wParam
? infoPtr
->MinVal
: infoPtr
->MaxVal
;
679 return infoPtr
->CurVal
;
681 case PBM_SETBARCOLOR
:
683 COLORREF clr
= infoPtr
->ColorBar
;
685 infoPtr
->ColorBar
= (COLORREF
)lParam
;
686 InvalidateRect(hwnd
, NULL
, TRUE
);
690 case PBM_GETBARCOLOR
:
691 return infoPtr
->ColorBar
;
695 COLORREF clr
= infoPtr
->ColorBk
;
697 infoPtr
->ColorBk
= (COLORREF
)lParam
;
698 InvalidateRect(hwnd
, NULL
, TRUE
);
703 return infoPtr
->ColorBk
;
706 if(wParam
!= PBST_NORMAL
)
707 FIXME("state %04lx not yet handled\n", wParam
);
716 infoPtr
->Marquee
= TRUE
;
717 SetTimer(infoPtr
->Self
, ID_MARQUEE_TIMER
, (UINT
)lParam
, NULL
);
721 infoPtr
->Marquee
= FALSE
;
722 KillTimer(infoPtr
->Self
, ID_MARQUEE_TIMER
);
724 return infoPtr
->Marquee
;
727 if ((message
>= WM_USER
) && (message
< WM_APP
) && !COMCTL32_IsReflectedMessage(message
))
728 ERR("unknown msg %04x wp=%04lx lp=%08lx\n", message
, wParam
, lParam
);
729 return DefWindowProcW( hwnd
, message
, wParam
, lParam
);
734 /***********************************************************************
735 * PROGRESS_Register [Internal]
737 * Registers the progress bar window class.
739 void PROGRESS_Register (void)
743 ZeroMemory (&wndClass
, sizeof(wndClass
));
744 wndClass
.style
= CS_GLOBALCLASS
| CS_VREDRAW
| CS_HREDRAW
;
745 wndClass
.lpfnWndProc
= ProgressWindowProc
;
746 wndClass
.cbClsExtra
= 0;
747 wndClass
.cbWndExtra
= sizeof (PROGRESS_INFO
*);
748 wndClass
.hCursor
= LoadCursorW (0, (LPWSTR
)IDC_ARROW
);
749 wndClass
.lpszClassName
= PROGRESS_CLASSW
;
751 RegisterClassW (&wndClass
);
755 /***********************************************************************
756 * PROGRESS_Unregister [Internal]
758 * Unregisters the progress bar window class.
760 void PROGRESS_Unregister (void)
762 UnregisterClassW (PROGRESS_CLASSW
, NULL
);