Last change
on this file since 29970 was 11670, checked in by mdewsnip, 18 years ago |
Some changes to get this to compile with Microsoft Visual C++ 4.2.
|
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.3 KB
|
Line | |
---|
1 | #ifndef _COPYPROGRESS_H_
|
---|
2 | #define _COPYPROGRESS_H_
|
---|
3 |
|
---|
4 | #include <windows.h>
|
---|
5 | #include <time.h>
|
---|
6 | #include <map>
|
---|
7 |
|
---|
8 | class copyProgressBar
|
---|
9 | { private:
|
---|
10 | unsigned long total;
|
---|
11 | unsigned long copied;
|
---|
12 | unsigned long totalFiles;
|
---|
13 | unsigned long copiedFiles;
|
---|
14 | HWND progressParent;
|
---|
15 | HWND progressBar;
|
---|
16 | HWND progressText;
|
---|
17 | HWND progressTime;
|
---|
18 | bool showing;
|
---|
19 | time_t startTime;
|
---|
20 |
|
---|
21 | public:
|
---|
22 | // constructors/destructors
|
---|
23 | copyProgressBar();
|
---|
24 |
|
---|
25 | copyProgressBar(unsigned long totalSize, unsigned long totalFiles);
|
---|
26 |
|
---|
27 | ~copyProgressBar(); // destructor introduced to ensure that open windows are closed
|
---|
28 |
|
---|
29 | void registerClass(); // does the registration of the window classes into Windows
|
---|
30 |
|
---|
31 | // the window procedure itself
|
---|
32 | LRESULT CALLBACK windowProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam);
|
---|
33 |
|
---|
34 | // timing methods
|
---|
35 | void setStartTime() { this->startTime = time(NULL); }
|
---|
36 |
|
---|
37 | // messaging methods
|
---|
38 | void done(unsigned long bytesDone);
|
---|
39 | void done(unsigned long bytesDone, LPSTR message);
|
---|
40 | void message(LPSTR message);
|
---|
41 |
|
---|
42 | // reinitialise the progress bar, giving a new total completion size
|
---|
43 | void init(unsigned long totalSize, unsigned long totalFiles);
|
---|
44 |
|
---|
45 | // show the progress bar
|
---|
46 | void show();
|
---|
47 |
|
---|
48 | // close (hide) the progress bar
|
---|
49 | void close();
|
---|
50 |
|
---|
51 | };
|
---|
52 |
|
---|
53 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.