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
60 #define DEFAULT_MARQUEE_PERIOD 30
62 /* Helper to obtain size of a progress bar chunk ("led"). */
63 static inline int get_led_size ( const PROGRESS_INFO
*infoPtr
, LONG style
,
66 HTHEME theme
= GetWindowTheme (infoPtr
->Self
);
70 if (SUCCEEDED( GetThemeInt( theme
, 0, 0, TMT_PROGRESSCHUNKSIZE
, &chunkSize
)))
74 if (style
& PBS_VERTICAL
)
75 return MulDiv (rect
->right
- rect
->left
, 2, 3);
77 return MulDiv (rect
->bottom
- rect
->top
, 2, 3);
80 /* Helper to obtain gap between progress bar chunks */
81 static inline int get_led_gap ( const PROGRESS_INFO
*infoPtr
)
83 HTHEME theme
= GetWindowTheme (infoPtr
->Self
);
87 if (SUCCEEDED( GetThemeInt( theme
, 0, 0, TMT_PROGRESSSPACESIZE
, &spaceSize
)))
94 /* Get client rect. Takes into account that theming needs no adjustment. */
95 static inline void get_client_rect (HWND hwnd
, RECT
* rect
)
97 HTHEME theme
= GetWindowTheme (hwnd
);
98 GetClientRect (hwnd
, rect
);
100 InflateRect(rect
, -1, -1);
103 DWORD dwStyle
= GetWindowLongW (hwnd
, GWL_STYLE
);
104 int part
= (dwStyle
& PBS_VERTICAL
) ? PP_BARVERT
: PP_BAR
;
105 GetThemeBackgroundContentRect (theme
, 0, part
, 0, rect
, rect
);
109 /* Compute the extend of the bar */
110 static inline int get_bar_size( LONG style
, const RECT
* rect
)
112 if (style
& PBS_VERTICAL
)
113 return rect
->bottom
- rect
->top
;
115 return rect
->right
- rect
->left
;
118 /* Compute the pixel position of a progress value */
119 static inline int get_bar_position( const PROGRESS_INFO
*infoPtr
, LONG style
,
120 const RECT
* rect
, INT value
)
122 return MulDiv (value
- infoPtr
->MinVal
, get_bar_size (style
, rect
),
123 infoPtr
->MaxVal
- infoPtr
->MinVal
);
126 /***********************************************************************
127 * PROGRESS_Invalidate
129 * Don't be too clever about invalidating the progress bar.
130 * InstallShield depends on this simple behaviour.
132 static void PROGRESS_Invalidate( const PROGRESS_INFO
*infoPtr
, INT old
, INT
new )
134 InvalidateRect( infoPtr
->Self
, NULL
, old
> new );
137 /* Information for a progress bar drawing helper */
138 typedef struct tagProgressDrawInfo
149 typedef void (*ProgressDrawProc
)(const ProgressDrawInfo
* di
, int start
, int end
);
151 /* draw solid horizontal bar from 'start' to 'end' */
152 static void draw_solid_bar_H (const ProgressDrawInfo
* di
, int start
, int end
)
155 SetRect(&r
, di
->rect
.left
+ start
, di
->rect
.top
, di
->rect
.left
+ end
, di
->rect
.bottom
);
156 FillRect (di
->hdc
, &r
, di
->hbrBar
);
159 /* draw solid horizontal background from 'start' to 'end' */
160 static void draw_solid_bkg_H (const ProgressDrawInfo
* di
, int start
, int end
)
163 SetRect(&r
, di
->rect
.left
+ start
, di
->rect
.top
, di
->rect
.left
+ end
, di
->rect
.bottom
);
164 FillRect (di
->hdc
, &r
, di
->hbrBk
);
167 /* draw solid vertical bar from 'start' to 'end' */
168 static void draw_solid_bar_V (const ProgressDrawInfo
* di
, int start
, int end
)
171 SetRect(&r
, di
->rect
.left
, di
->rect
.bottom
- end
, di
->rect
.right
, di
->rect
.bottom
- start
);
172 FillRect (di
->hdc
, &r
, di
->hbrBar
);
175 /* draw solid vertical background from 'start' to 'end' */
176 static void draw_solid_bkg_V (const ProgressDrawInfo
* di
, int start
, int end
)
179 SetRect(&r
, di
->rect
.left
, di
->rect
.bottom
- end
, di
->rect
.right
, di
->rect
.bottom
- start
);
180 FillRect (di
->hdc
, &r
, di
->hbrBk
);
183 /* draw chunky horizontal bar from 'start' to 'end' */
184 static void draw_chunk_bar_H (const ProgressDrawInfo
* di
, int start
, int end
)
187 int right
= di
->rect
.left
+ end
;
188 r
.left
= di
->rect
.left
+ start
;
189 r
.top
= di
->rect
.top
;
190 r
.bottom
= di
->rect
.bottom
;
191 while (r
.left
< right
)
193 r
.right
= min (r
.left
+ di
->ledW
, right
);
194 FillRect (di
->hdc
, &r
, di
->hbrBar
);
196 r
.right
= min (r
.left
+ di
->ledGap
, right
);
197 FillRect (di
->hdc
, &r
, di
->hbrBk
);
202 /* draw chunky vertical bar from 'start' to 'end' */
203 static void draw_chunk_bar_V (const ProgressDrawInfo
* di
, int start
, int end
)
206 int top
= di
->rect
.bottom
- end
;
207 r
.left
= di
->rect
.left
;
208 r
.right
= di
->rect
.right
;
209 r
.bottom
= di
->rect
.bottom
- start
;
210 while (r
.bottom
> top
)
212 r
.top
= max (r
.bottom
- di
->ledW
, top
);
213 FillRect (di
->hdc
, &r
, di
->hbrBar
);
215 r
.top
= max (r
.bottom
- di
->ledGap
, top
);
216 FillRect (di
->hdc
, &r
, di
->hbrBk
);
221 /* drawing functions for "classic" style */
222 static const ProgressDrawProc drawProcClassic
[8] = {
225 draw_solid_bar_H
, draw_solid_bkg_H
,
227 draw_solid_bar_V
, draw_solid_bkg_V
,
230 draw_chunk_bar_H
, draw_solid_bkg_H
,
232 draw_chunk_bar_V
, draw_solid_bkg_V
,
235 /* draw themed horizontal bar from 'start' to 'end' */
236 static void draw_theme_bar_H (const ProgressDrawInfo
* di
, int start
, int end
)
239 r
.left
= di
->rect
.left
+ start
;
240 r
.top
= di
->rect
.top
;
241 r
.bottom
= di
->rect
.bottom
;
242 r
.right
= di
->rect
.left
+ end
;
243 DrawThemeBackground (di
->theme
, di
->hdc
, PP_CHUNK
, 0, &r
, NULL
);
246 /* draw themed vertical bar from 'start' to 'end' */
247 static void draw_theme_bar_V (const ProgressDrawInfo
* di
, int start
, int end
)
250 r
.left
= di
->rect
.left
;
251 r
.right
= di
->rect
.right
;
252 r
.bottom
= di
->rect
.bottom
- start
;
253 r
.top
= di
->rect
.bottom
- end
;
254 DrawThemeBackground (di
->theme
, di
->hdc
, PP_CHUNKVERT
, 0, &r
, NULL
);
257 /* draw themed horizontal background from 'start' to 'end' */
258 static void draw_theme_bkg_H (const ProgressDrawInfo
* di
, int start
, int end
)
262 SetRect(&r
, di
->rect
.left
+ start
, di
->rect
.top
, di
->rect
.left
+ end
, di
->rect
.bottom
);
264 OffsetRect(&bgrect
, -bgrect
.left
, -bgrect
.top
);
266 DrawThemeBackground (di
->theme
, di
->hdc
, PP_BAR
, 0, &bgrect
, &r
);
269 /* draw themed vertical background from 'start' to 'end' */
270 static void draw_theme_bkg_V (const ProgressDrawInfo
* di
, int start
, int end
)
274 SetRect(&r
, di
->rect
.left
, di
->rect
.bottom
- end
, di
->rect
.right
, di
->rect
.bottom
- start
);
276 OffsetRect(&bgrect
, -bgrect
.left
, -bgrect
.top
);
278 DrawThemeBackground (di
->theme
, di
->hdc
, PP_BARVERT
, 0, &bgrect
, &r
);
281 /* drawing functions for themed style */
282 static const ProgressDrawProc drawProcThemed
[8] = {
285 draw_theme_bar_H
, draw_theme_bkg_H
,
287 draw_theme_bar_V
, draw_theme_bkg_V
,
290 draw_theme_bar_H
, draw_theme_bkg_H
,
292 draw_theme_bar_V
, draw_theme_bkg_V
,
295 /***********************************************************************
297 * Draws the progress bar.
299 static LRESULT
PROGRESS_Draw (PROGRESS_INFO
*infoPtr
, HDC hdc
)
304 const ProgressDrawProc
* drawProcs
;
305 ProgressDrawInfo pdi
;
307 TRACE("(infoPtr=%p, hdc=%p)\n", infoPtr
, hdc
);
310 pdi
.theme
= GetWindowTheme (infoPtr
->Self
);
312 /* get the required bar brush */
313 if (infoPtr
->ColorBar
== CLR_DEFAULT
)
314 pdi
.hbrBar
= GetSysColorBrush(COLOR_HIGHLIGHT
);
316 pdi
.hbrBar
= CreateSolidBrush (infoPtr
->ColorBar
);
318 if (infoPtr
->ColorBk
== CLR_DEFAULT
)
319 pdi
.hbrBk
= GetSysColorBrush(COLOR_3DFACE
);
321 pdi
.hbrBk
= CreateSolidBrush(infoPtr
->ColorBk
);
323 /* get the window style */
324 dwStyle
= GetWindowLongW (infoPtr
->Self
, GWL_STYLE
);
326 /* get client rectangle */
327 GetClientRect (infoPtr
->Self
, &pdi
.rect
);
329 FrameRect( hdc
, &pdi
.rect
, pdi
.hbrBk
);
330 InflateRect(&pdi
.rect
, -1, -1);
335 int part
= (dwStyle
& PBS_VERTICAL
) ? PP_BARVERT
: PP_BAR
;
337 GetThemeBackgroundContentRect (pdi
.theme
, hdc
, part
, 0, &pdi
.rect
,
340 /* Exclude content rect - content background will be drawn later */
341 ExcludeClipRect (hdc
, cntRect
.left
, cntRect
.top
,
342 cntRect
.right
, cntRect
.bottom
);
343 if (IsThemeBackgroundPartiallyTransparent (pdi
.theme
, part
, 0))
344 DrawThemeParentBackground (infoPtr
->Self
, hdc
, NULL
);
345 DrawThemeBackground (pdi
.theme
, hdc
, part
, 0, &pdi
.rect
, NULL
);
346 SelectClipRgn (hdc
, NULL
);
350 /* compute some drawing parameters */
351 barSmooth
= (dwStyle
& PBS_SMOOTH
) && !pdi
.theme
;
352 drawProcs
= &((pdi
.theme
? drawProcThemed
: drawProcClassic
)[(barSmooth
? 0 : 4)
353 + ((dwStyle
& PBS_VERTICAL
) ? 2 : 0)]);
354 barSize
= get_bar_size( dwStyle
, &pdi
.rect
);
357 GetWindowRect( infoPtr
->Self
, &pdi
.bgRect
);
358 MapWindowPoints( infoPtr
->Self
, 0, (POINT
*)&pdi
.bgRect
, 2 );
362 pdi
.ledW
= get_led_size( infoPtr
, dwStyle
, &pdi
.rect
);
363 pdi
.ledGap
= get_led_gap( infoPtr
);
365 if (dwStyle
& PBS_MARQUEE
)
367 const int ledW
= !barSmooth
? (pdi
.ledW
+ pdi
.ledGap
) : 1;
368 const int leds
= (barSize
+ ledW
- 1) / ledW
;
369 const int ledMEnd
= infoPtr
->MarqueePos
+ MARQUEE_LEDS
;
373 /* case 1: the marquee bar extends over the end and wraps around to
375 const int gapStart
= max((ledMEnd
- leds
) * ledW
, 0);
376 const int gapEnd
= min(infoPtr
->MarqueePos
* ledW
, barSize
);
378 drawProcs
[0]( &pdi
, 0, gapStart
);
379 drawProcs
[1]( &pdi
, gapStart
, gapEnd
);
380 drawProcs
[0]( &pdi
, gapEnd
, barSize
);
384 /* case 2: the marquee bar is between start and end */
385 const int barStart
= infoPtr
->MarqueePos
* ledW
;
386 const int barEnd
= min (ledMEnd
* ledW
, barSize
);
388 drawProcs
[1]( &pdi
, 0, barStart
);
389 drawProcs
[0]( &pdi
, barStart
, barEnd
);
390 drawProcs
[1]( &pdi
, barEnd
, barSize
);
395 int barEnd
= get_bar_position( infoPtr
, dwStyle
, &pdi
.rect
,
399 const int ledW
= pdi
.ledW
+ pdi
.ledGap
;
400 barEnd
= min (((barEnd
+ ledW
- 1) / ledW
) * ledW
, barSize
);
402 drawProcs
[0]( &pdi
, 0, barEnd
);
403 drawProcs
[1]( &pdi
, barEnd
, barSize
);
406 /* delete bar brush */
407 if (infoPtr
->ColorBar
!= CLR_DEFAULT
) DeleteObject (pdi
.hbrBar
);
408 if (infoPtr
->ColorBk
!= CLR_DEFAULT
) DeleteObject (pdi
.hbrBk
);
413 /***********************************************************************
415 * Draw the progress bar. The background need not be erased.
416 * If dc!=0, it draws on it
418 static LRESULT
PROGRESS_Paint (PROGRESS_INFO
*infoPtr
, HDC hdc
)
421 if (hdc
) return PROGRESS_Draw (infoPtr
, hdc
);
422 hdc
= BeginPaint (infoPtr
->Self
, &ps
);
423 PROGRESS_Draw (infoPtr
, hdc
);
424 EndPaint (infoPtr
->Self
, &ps
);
429 /***********************************************************************
430 * Advance marquee progress by one step.
432 static void PROGRESS_UpdateMarquee (PROGRESS_INFO
*infoPtr
)
434 LONG style
= GetWindowLongW (infoPtr
->Self
, GWL_STYLE
);
437 HTHEME theme
= GetWindowTheme (infoPtr
->Self
);
438 BOOL smooth
= (style
& PBS_SMOOTH
) && !theme
;
440 get_client_rect (infoPtr
->Self
, &rect
);
445 ledWidth
= get_led_size( infoPtr
, style
, &rect
) + get_led_gap( infoPtr
);
447 leds
= (get_bar_size( style
, &rect
) + ledWidth
- 1) /
450 /* increment the marquee progress */
451 if (++infoPtr
->MarqueePos
>= leds
)
452 infoPtr
->MarqueePos
= 0;
454 InvalidateRect(infoPtr
->Self
, &rect
, TRUE
);
455 UpdateWindow(infoPtr
->Self
);
459 /***********************************************************************
461 * Makes sure the current position (CurVal) is within bounds.
463 static void PROGRESS_CoercePos(PROGRESS_INFO
*infoPtr
)
465 if(infoPtr
->CurVal
< infoPtr
->MinVal
)
466 infoPtr
->CurVal
= infoPtr
->MinVal
;
467 if(infoPtr
->CurVal
> infoPtr
->MaxVal
)
468 infoPtr
->CurVal
= infoPtr
->MaxVal
;
472 /***********************************************************************
474 * Set new Font for progress bar
476 static HFONT
PROGRESS_SetFont (PROGRESS_INFO
*infoPtr
, HFONT hFont
, BOOL bRedraw
)
478 HFONT hOldFont
= infoPtr
->Font
;
479 infoPtr
->Font
= hFont
;
480 /* Since infoPtr->Font is not used, there is no need for repaint */
484 static DWORD
PROGRESS_SetRange (PROGRESS_INFO
*infoPtr
, int low
, int high
)
486 DWORD res
= MAKELONG(LOWORD(infoPtr
->MinVal
), LOWORD(infoPtr
->MaxVal
));
488 /* if nothing changes, simply return */
489 if(infoPtr
->MinVal
== low
&& infoPtr
->MaxVal
== high
) return res
;
491 infoPtr
->MinVal
= low
;
492 infoPtr
->MaxVal
= high
;
493 PROGRESS_CoercePos(infoPtr
);
494 InvalidateRect(infoPtr
->Self
, NULL
, TRUE
);
498 static UINT
PROGRESS_SetPos (PROGRESS_INFO
*infoPtr
, INT pos
)
500 DWORD style
= GetWindowLongW(infoPtr
->Self
, GWL_STYLE
);
502 if (style
& PBS_MARQUEE
)
504 PROGRESS_UpdateMarquee(infoPtr
);
510 oldVal
= infoPtr
->CurVal
;
512 infoPtr
->CurVal
= pos
;
513 PROGRESS_CoercePos(infoPtr
);
514 TRACE("PBM_SETPOS: current pos changed from %d to %d\n", oldVal
, infoPtr
->CurVal
);
515 PROGRESS_Invalidate( infoPtr
, oldVal
, infoPtr
->CurVal
);
516 UpdateWindow( infoPtr
->Self
);
522 /***********************************************************************
525 static LRESULT WINAPI
ProgressWindowProc(HWND hwnd
, UINT message
,
526 WPARAM wParam
, LPARAM lParam
)
528 PROGRESS_INFO
*infoPtr
;
529 static const WCHAR themeClass
[] = {'P','r','o','g','r','e','s','s',0};
532 TRACE("hwnd=%p msg=%04x wparam=%lx lParam=%lx\n", hwnd
, message
, wParam
, lParam
);
534 infoPtr
= (PROGRESS_INFO
*)GetWindowLongPtrW(hwnd
, 0);
536 if (!infoPtr
&& message
!= WM_CREATE
)
537 return DefWindowProcW( hwnd
, message
, wParam
, lParam
);
542 DWORD dwExStyle
= GetWindowLongW (hwnd
, GWL_EXSTYLE
);
544 theme
= OpenThemeData (hwnd
, themeClass
);
546 dwExStyle
&= ~(WS_EX_CLIENTEDGE
| WS_EX_WINDOWEDGE
);
547 if (!theme
) dwExStyle
|= WS_EX_STATICEDGE
;
548 SetWindowLongW (hwnd
, GWL_EXSTYLE
, dwExStyle
);
549 /* Force recalculation of a non-client area */
550 SetWindowPos(hwnd
, 0, 0, 0, 0, 0,
551 SWP_FRAMECHANGED
| SWP_NOSIZE
| SWP_NOMOVE
| SWP_NOZORDER
| SWP_NOACTIVATE
);
553 /* allocate memory for info struct */
554 infoPtr
= Alloc (sizeof(PROGRESS_INFO
));
555 if (!infoPtr
) return -1;
556 SetWindowLongPtrW (hwnd
, 0, (DWORD_PTR
)infoPtr
);
558 /* initialize the info struct */
559 infoPtr
->Self
= hwnd
;
561 infoPtr
->MaxVal
= 100;
564 infoPtr
->MarqueePos
= 0;
565 infoPtr
->Marquee
= FALSE
;
566 infoPtr
->ColorBar
= CLR_DEFAULT
;
567 infoPtr
->ColorBk
= CLR_DEFAULT
;
570 TRACE("Progress Ctrl creation, hwnd=%p\n", hwnd
);
575 TRACE("Progress Ctrl destruction, hwnd=%p\n", hwnd
);
577 SetWindowLongPtrW(hwnd
, 0, 0);
578 theme
= GetWindowTheme (hwnd
);
579 CloseThemeData (theme
);
586 return (LRESULT
)infoPtr
->Font
;
589 return (LRESULT
)PROGRESS_SetFont(infoPtr
, (HFONT
)wParam
, (BOOL
)lParam
);
593 return PROGRESS_Paint (infoPtr
, (HDC
)wParam
);
596 if (wParam
== ID_MARQUEE_TIMER
)
597 PROGRESS_UpdateMarquee (infoPtr
);
600 case WM_THEMECHANGED
:
602 DWORD dwExStyle
= GetWindowLongW (hwnd
, GWL_EXSTYLE
);
604 theme
= GetWindowTheme (hwnd
);
605 CloseThemeData (theme
);
606 theme
= OpenThemeData (hwnd
, themeClass
);
608 /* WS_EX_STATICEDGE disappears when the control is themed */
610 dwExStyle
&= ~WS_EX_STATICEDGE
;
612 dwExStyle
|= WS_EX_STATICEDGE
;
613 SetWindowLongW (hwnd
, GWL_EXSTYLE
, dwExStyle
);
615 InvalidateRect (hwnd
, NULL
, FALSE
);
622 oldVal
= infoPtr
->CurVal
;
624 infoPtr
->CurVal
+= (INT
)wParam
;
625 PROGRESS_CoercePos (infoPtr
);
626 TRACE("PBM_DELTAPOS: current pos changed from %d to %d\n", oldVal
, infoPtr
->CurVal
);
627 PROGRESS_Invalidate( infoPtr
, oldVal
, infoPtr
->CurVal
);
628 UpdateWindow( infoPtr
->Self
);
634 return PROGRESS_SetPos(infoPtr
, wParam
);
637 return PROGRESS_SetRange (infoPtr
, (int)LOWORD(lParam
), (int)HIWORD(lParam
));
642 oldStep
= infoPtr
->Step
;
643 infoPtr
->Step
= (INT
)wParam
;
648 return infoPtr
->Step
;
653 oldVal
= infoPtr
->CurVal
;
654 infoPtr
->CurVal
+= infoPtr
->Step
;
655 if(infoPtr
->CurVal
> infoPtr
->MaxVal
)
656 infoPtr
->CurVal
= infoPtr
->MinVal
;
657 if(oldVal
!= infoPtr
->CurVal
)
659 TRACE("PBM_STEPIT: current pos changed from %d to %d\n", oldVal
, infoPtr
->CurVal
);
660 PROGRESS_Invalidate( infoPtr
, oldVal
, infoPtr
->CurVal
);
661 UpdateWindow( infoPtr
->Self
);
667 return PROGRESS_SetRange (infoPtr
, (int)wParam
, (int)lParam
);
671 ((PPBRANGE
)lParam
)->iLow
= infoPtr
->MinVal
;
672 ((PPBRANGE
)lParam
)->iHigh
= infoPtr
->MaxVal
;
674 return wParam
? infoPtr
->MinVal
: infoPtr
->MaxVal
;
677 return infoPtr
->CurVal
;
679 case PBM_SETBARCOLOR
:
681 COLORREF clr
= infoPtr
->ColorBar
;
683 infoPtr
->ColorBar
= (COLORREF
)lParam
;
684 InvalidateRect(hwnd
, NULL
, TRUE
);
688 case PBM_GETBARCOLOR
:
689 return infoPtr
->ColorBar
;
693 COLORREF clr
= infoPtr
->ColorBk
;
695 infoPtr
->ColorBk
= (COLORREF
)lParam
;
696 InvalidateRect(hwnd
, NULL
, TRUE
);
701 return infoPtr
->ColorBk
;
704 if(wParam
!= PBST_NORMAL
)
705 FIXME("state %04lx not yet handled\n", wParam
);
714 UINT period
= lParam
? (UINT
)lParam
: DEFAULT_MARQUEE_PERIOD
;
715 infoPtr
->Marquee
= TRUE
;
716 SetTimer(infoPtr
->Self
, ID_MARQUEE_TIMER
, period
, NULL
);
720 infoPtr
->Marquee
= FALSE
;
721 KillTimer(infoPtr
->Self
, ID_MARQUEE_TIMER
);
723 return infoPtr
->Marquee
;
726 if ((message
>= WM_USER
) && (message
< WM_APP
) && !COMCTL32_IsReflectedMessage(message
))
727 ERR("unknown msg %04x wp=%04lx lp=%08lx\n", message
, wParam
, lParam
);
728 return DefWindowProcW( hwnd
, message
, wParam
, lParam
);
733 /***********************************************************************
734 * PROGRESS_Register [Internal]
736 * Registers the progress bar window class.
738 void PROGRESS_Register (void)
742 ZeroMemory (&wndClass
, sizeof(wndClass
));
743 wndClass
.style
= CS_GLOBALCLASS
| CS_VREDRAW
| CS_HREDRAW
;
744 wndClass
.lpfnWndProc
= ProgressWindowProc
;
745 wndClass
.cbClsExtra
= 0;
746 wndClass
.cbWndExtra
= sizeof (PROGRESS_INFO
*);
747 wndClass
.hCursor
= LoadCursorW (0, (LPWSTR
)IDC_ARROW
);
748 wndClass
.lpszClassName
= PROGRESS_CLASSW
;
750 RegisterClassW (&wndClass
);
754 /***********************************************************************
755 * PROGRESS_Unregister [Internal]
757 * Unregisters the progress bar window class.
759 void PROGRESS_Unregister (void)
761 UnregisterClassW (PROGRESS_CLASSW
, NULL
);