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