ReactOS 0.4.16-dev-930-gcc8ec38
CProgressDlg Class Reference

#include <CProgressDlg.hpp>

Public Member Functions

 ~CProgressDlg ()
 
void Start (DWORD dwTotalSteps, LPCWSTR Title, LPCWSTR Text)
 
void Step (DWORD dwProgress, LPCWSTR Text)
 
void Stop ()
 

Private Attributes

CComPtr< IProgressDialog > m_spProgress
 
DWORD m_dwTotal = 0
 

Detailed Description

Definition at line 10 of file CProgressDlg.hpp.

Constructor & Destructor Documentation

◆ ~CProgressDlg()

CProgressDlg::~CProgressDlg ( )
inline

Definition at line 16 of file CProgressDlg.hpp.

17 {
18 Stop();
19 }

Member Function Documentation

◆ Start()

void CProgressDlg::Start ( DWORD  dwTotalSteps,
LPCWSTR  Title,
LPCWSTR  Text 
)
inline

Definition at line 22 of file CProgressDlg.hpp.

23 {
24 HRESULT hr = CoCreateInstance(CLSID_ProgressDialog, NULL, CLSCTX_INPROC, IID_PPV_ARG(IProgressDialog, &m_spProgress));
26 return;
27
28 m_dwTotal = dwTotalSteps;
29
30 m_spProgress->SetTitle(Title);
31 m_spProgress->SetLine(2, Text, TRUE, NULL);
32 m_spProgress->StartProgressDialog(NULL, NULL, PROGDLG_NOMINIMIZE, NULL);
33 m_spProgress->SetProgress(0, m_dwTotal);
34 }
CComPtr< IProgressDialog > m_spProgress
char * Text
Definition: combotst.c:136
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
static const WCHAR Title[]
Definition: oid.c:1259
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT hr
Definition: shlfolder.c:183
#define PROGDLG_NOMINIMIZE
Definition: shlobj.h:976
#define IID_PPV_ARG(Itype, ppType)

◆ Step()

void CProgressDlg::Step ( DWORD  dwProgress,
LPCWSTR  Text 
)
inline

Definition at line 36 of file CProgressDlg.hpp.

37 {
38 m_spProgress->SetProgress(dwProgress, m_dwTotal);
39 m_spProgress->SetLine(1, Text, TRUE, NULL);
40 }

◆ Stop()

void CProgressDlg::Stop ( )
inline

Definition at line 42 of file CProgressDlg.hpp.

43 {
44 if (m_spProgress)
45 {
46 m_spProgress->StopProgressDialog();
47 m_spProgress.Release();
48 }
49 }

Referenced by ~CProgressDlg().

Member Data Documentation

◆ m_dwTotal

DWORD CProgressDlg::m_dwTotal = 0
private

Definition at line 13 of file CProgressDlg.hpp.

Referenced by Start(), and Step().

◆ m_spProgress

CComPtr<IProgressDialog> CProgressDlg::m_spProgress
private

Definition at line 12 of file CProgressDlg.hpp.

Referenced by Start(), Step(), and Stop().


The documentation for this class was generated from the following file: