From 5c521d256815161f4af9066bc4bb9fea7fa1accb Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 16 Sep 2003 13:44:06 +0000 Subject: Initial Import --- DropDlg.h | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 DropDlg.h (limited to 'DropDlg.h') diff --git a/DropDlg.h b/DropDlg.h new file mode 100644 index 0000000..ac6613c --- /dev/null +++ b/DropDlg.h @@ -0,0 +1,63 @@ +// DropDlg.h : Declaration of the CDropDlg + +#ifndef __DROPDLG_H_ +#define __DROPDLG_H_ + +#include "resource.h" // main symbols +#include + +///////////////////////////////////////////////////////////////////////////// +// CDropDlg +class CDropDlg : + public CDialogImpl, + public CSizingDialog, + public CPersistPosWindow +{ +public: + CDropDlg(); + + enum { IDD = IDD_DROPDLG }; + +BEGIN_MSG_MAP(CDropDlg) + MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) + MESSAGE_HANDLER(WM_DESTROY, OnDestroy) + MESSAGE_HANDLER(WM_DROPFILES, OnDropFiles) + COMMAND_ID_HANDLER(IDC_RUN, OnRun) + COMMAND_ID_HANDLER(IDOK, OnClose) + COMMAND_ID_HANDLER(IDCANCEL, OnClose) + CHAIN_MSG_MAP(CSizingDialog) +END_MSG_MAP() + +// Handler prototypes: +// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); +// LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); +// LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); + + LRESULT OnRun(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); + LRESULT OnDropFiles(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnClose(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); + +protected: + void SetRunMode(bool isRunning); + void ReportError(HRESULT hr); + + string GetCurBatch(); + HRESULT RunWithFolder(const string& batch, const string& folderName); + HRESULT RunWithFile(const string& batch, const string& fileName); + + static BOOL WINAPI OutputString(LPCTSTR data, LPVOID param); + static string CleanFolder(const string& folderName); + static bool IsDots(const string& fileName); + + CEdit m_ctlLog; + CComboBox m_ctlBatch; + string m_baseDir; + CRegSettings m_settings; // Our registry key + + bool m_isRunning; + bool m_isCancelled; +}; + +#endif //__DROPDLG_H_ -- cgit v1.2.3