summaryrefslogtreecommitdiffstats
path: root/mmc_updater/src/UpdateDialogWin32.h
blob: fe4208c8630a5f6871a1e187115d1a5b79f96e77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once

#include "Platform.h"
#include "UpdateDialog.h"
#include "UpdateMessage.h"

#include "wincore.h"
#include "controls.h"
#include "stdcontrols.h"

class UpdateDialogWin32 : public UpdateDialog
{
	public:
		UpdateDialogWin32();
		~UpdateDialogWin32();

		// implements UpdateDialog
		virtual void init(int argc, char** argv);
		virtual void exec();
		virtual void quit();

		// implements UpdateObserver
		virtual void updateError(const std::string& errorMessage);
		virtual void updateProgress(int percentage);
		virtual void updateFinished();

		LRESULT WINAPI windowProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam);

	private:
		void installWindowProc(CWnd* window);

		CWinApp m_app;
		CWnd m_window;
		CStatic m_progressLabel;
		CProgressBar m_progressBar;
		CButton m_finishButton;
		bool m_hadError;
};