1 // Windows/Control/ProgressBar.h
2 
3 #ifndef __WINDOWS_CONTROL_PROGRESSBAR_H
4 #define __WINDOWS_CONTROL_PROGRESSBAR_H
5 
6 #include "../../Common/MyWindows.h"
7 
8 #include <commctrl.h>
9 
10 #include "../Window.h"
11 
12 namespace NWindows {
13 namespace NControl {
14 
15 class CProgressBar: public CWindow
16 {
17 public:
SetPos(int pos)18   LRESULT SetPos(int pos) { return SendMsg(PBM_SETPOS, pos, 0); }
DeltaPos(int increment)19   LRESULT DeltaPos(int increment) { return SendMsg(PBM_DELTAPOS, increment, 0); }
GetPos()20   UINT GetPos() { return (UINT)SendMsg(PBM_GETPOS, 0, 0); }
SetRange(unsigned short minValue,unsigned short maxValue)21   LRESULT SetRange(unsigned short minValue, unsigned short maxValue) { return SendMsg(PBM_SETRANGE, 0, MAKELPARAM(minValue, maxValue)); }
SetRange32(int minValue,int maxValue)22   DWORD SetRange32(int minValue, int maxValue) { return (DWORD)SendMsg(PBM_SETRANGE32, minValue, maxValue); }
SetStep(int step)23   int SetStep(int step) { return (int)SendMsg(PBM_SETSTEP, step, 0); }
StepIt()24   LRESULT StepIt() { return SendMsg(PBM_STEPIT, 0, 0); }
GetRange(bool minValue,PPBRANGE range)25   INT GetRange(bool minValue, PPBRANGE range) { return (INT)SendMsg(PBM_GETRANGE, BoolToBOOL(minValue), (LPARAM)range); }
26 
27   #ifndef UNDER_CE
SetBarColor(COLORREF color)28   COLORREF SetBarColor(COLORREF color) { return (COLORREF)SendMsg(PBM_SETBARCOLOR, 0, color); }
SetBackgroundColor(COLORREF color)29   COLORREF SetBackgroundColor(COLORREF color) { return (COLORREF)SendMsg(PBM_SETBKCOLOR, 0, color); }
30   #endif
31 };
32 
33 }}
34 
35 #endif
36