// 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_