Lhaz
lhazprg.h
[詳解]
1 /*==========================================================================*/
2 /* Lhaz Progress Bar chitora48@gmail.com */
3 /*==========================================================================*/
4 #pragma once
5 
6 #include <windows.h>
7 #include <commctrl.h>
8 #include <shobjidl.h>
9 
10 class LHAZPRG {
11 public:
12  LHAZPRG(HINSTANCE hins, HWND parent, DWORD style, bool taskbar = false);
13  LHAZPRG(HINSTANCE hins, HWND parent, DWORD style, int x, int y, int nWidth, int nHeight, bool taskbar = false);
14  ‾LHAZPRG(void);
15  //
16  HWND GetHwnd(void) { return Hwnd; }
17  void SetRange(int max) { if (Hwnd) SendMessage(Hwnd, PBM_SETRANGE, 0, MAKELPARAM(0, max)); }
18  void SetStep(int step) { if (Hwnd) SendMessage(Hwnd, PBM_SETSTEP, step, 0); }
19  void StepIt(void) { if (Hwnd) SendMessage(Hwnd, PBM_STEPIT, 0, 0); }
20  void SetTotal(LONGLONG t) { Total = t; Pos = 0; }
21  void SetMelted(LONGLONG m) { Melted = m; Progress(0); }
22  void Show(void) { ShowWindow(Hwnd, SW_SHOW); }
23  void Hide(void) { ShowWindow(Hwnd, SW_HIDE); }
24  void SetPos(int pos);
25  void ChgStyle(DWORD style);
26  void Progress(unsigned int size);
27  void MoveWindow(int X, int nWidth);
28 
29 private:
30  static const int DEF_X;
31  static const int DEF_Y;
32  static const int DEF_WIDTH;
33  static const int DEF_HEIGHT;
34  //
35  HWND Hwnd;
36  HINSTANCE Instance;
37  HWND Parent;
38  int X;
39  int Y;
40  int Width;
41  int Height;
42  LONGLONG Total;
43  LONGLONG Melted;
44  unsigned int Pos;
45  ITaskbarList3* m_ptl;
46  //
47  void Create(DWORD style);
48 
49 };
void Show(void)
Definition: lhazprg.h:22
unsigned int Pos
Definition: lhazprg.h:44
HWND Parent
Definition: lhazprg.h:37
void Create(DWORD style)
Definition: lhazprg.cpp:64
LONGLONG Melted
Definition: lhazprg.h:43
int Y
Definition: lhazprg.h:39
void SetStep(int step)
Definition: lhazprg.h:18
HWND GetHwnd(void)
Definition: lhazprg.h:16
int X
Definition: lhazprg.h:38
HWND Hwnd
Definition: lhazprg.h:35
HINSTANCE Instance
Definition: lhazprg.h:36
int Height
Definition: lhazprg.h:41
static const int DEF_X
Definition: lhazprg.h:30
static const int DEF_Y
Definition: lhazprg.h:31
void ChgStyle(DWORD style)
Definition: lhazprg.cpp:95
static const int DEF_WIDTH
Definition: lhazprg.h:32
static const int DEF_HEIGHT
Definition: lhazprg.h:33
LONGLONG Total
Definition: lhazprg.h:42
‾LHAZPRG(void)
Definition: lhazprg.cpp:84
void MoveWindow(int X, int nWidth)
Definition: lhazprg.cpp:129
void Hide(void)
Definition: lhazprg.h:23
void SetRange(int max)
Definition: lhazprg.h:17
void StepIt(void)
Definition: lhazprg.h:19
int Width
Definition: lhazprg.h:40
Definition: lhazprg.h:10
void SetTotal(LONGLONG t)
Definition: lhazprg.h:20
ITaskbarList3 * m_ptl
Definition: lhazprg.h:45
void SetMelted(LONGLONG m)
Definition: lhazprg.h:21
void Progress(unsigned int size)
Definition: lhazprg.cpp:104
LHAZPRG(HINSTANCE hins, HWND parent, DWORD style, bool taskbar=false)
Definition: lhazprg.cpp:15
void SetPos(int pos)
Definition: lhazprg.cpp:139