diff options
Diffstat (limited to 'DropDlg.h')
-rw-r--r-- | DropDlg.h | 63 |
1 files changed, 63 insertions, 0 deletions
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 <atlhost.h> + +///////////////////////////////////////////////////////////////////////////// +// CDropDlg +class CDropDlg : + public CDialogImpl<CDropDlg>, + public CSizingDialog<CDropDlg>, + public CPersistPosWindow<CDropDlg> +{ +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<CDropDlg>) +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_ |