#ifndef _COPYPROGRESS_H_ #define _COPYPROGRESS_H_ #include #include class copyProgressBar { private: unsigned long total; unsigned long copied; unsigned long totalFiles; unsigned long copiedFiles; HWND progressParent; HWND progressBar; HWND progressText; HWND progressTime; bool showing; time_t startTime; public: // constructors/destructors copyProgressBar(); copyProgressBar(unsigned long totalSize, unsigned long totalFiles); ~copyProgressBar(); // destructor introduced to ensure that open windows are closed void registerClass(); // does the registration of the window classes into Windows // the window procedure itself LRESULT CALLBACK windowProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam); // timing methods void setStartTime() { this->startTime = time(NULL); } // messaging methods void done(unsigned long bytesDone); void done(unsigned long bytesDone, LPSTR message); void message(LPSTR message); // reinitialise the progress bar, giving a new total completion size void init(unsigned long totalSize, unsigned long totalFiles); // show the progress bar void show(); // close (hide) the progress bar void close(); }; #endif