mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
71 lines
2.0 KiB
C
71 lines
2.0 KiB
C
|
/*
|
||
|
Copyright (C) 2011 Birunthan Mohanathas
|
||
|
|
||
|
This program is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU General Public License
|
||
|
as published by the Free Software Foundation; either version 2
|
||
|
of the License, or (at your option) any later version.
|
||
|
|
||
|
This program is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
GNU General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU General Public License
|
||
|
along with this program; if not, write to the Free Software
|
||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||
|
*/
|
||
|
|
||
|
#ifndef _DIALOGBACKUP_H_
|
||
|
#define _DIALOGBACKUP_H_
|
||
|
|
||
|
#include <string>
|
||
|
#include "zip.h"
|
||
|
#include "../Library/Dialog.h"
|
||
|
|
||
|
class CDialogBackup : public CDialog
|
||
|
{
|
||
|
public:
|
||
|
static void Create(HINSTANCE hInstance, LPWSTR lpCmdLine);
|
||
|
|
||
|
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||
|
INT_PTR OnInitDialog(WPARAM wParam, LPARAM lParam);
|
||
|
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
|
||
|
|
||
|
static CDialogBackup* c_Dialog;
|
||
|
|
||
|
private:
|
||
|
class CTabBackup : public CTab
|
||
|
{
|
||
|
public:
|
||
|
CTabBackup(HWND window);
|
||
|
|
||
|
virtual void Initialize();
|
||
|
|
||
|
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||
|
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
|
||
|
};
|
||
|
|
||
|
CDialogBackup(HWND wnd);
|
||
|
virtual ~CDialogBackup();
|
||
|
|
||
|
void StartBackup();
|
||
|
bool CreateBackup();
|
||
|
static unsigned __stdcall BackupThreadProc(void* pParam);
|
||
|
|
||
|
bool AddFileToBackup(const char* realPath, const char* zipPath);
|
||
|
bool AddFolderToBackup(const std::wstring& path, std::wstring base, char* zipPrefix, bool recursive);
|
||
|
|
||
|
CTabBackup m_TabBackup;
|
||
|
|
||
|
std::wstring m_TargetFile;
|
||
|
|
||
|
HANDLE m_ThreadHandle;
|
||
|
|
||
|
zipFile m_ZipFile;
|
||
|
void* m_WriteBuffer;
|
||
|
static const int c_WriteBufferSize = 16384;
|
||
|
};
|
||
|
|
||
|
#endif
|