// ProgressDlg.h : Declaration of the CActionProgressDlg #ifndef __ProgressDLG_H_ #define __ProgressDLG_H_ #include "resource.h" // main symbols #include #include #include "NSMessages.h" #include "../common/events.h" #include "../common/interfaces.h" #include "NightSecError.h" ///////////////////////////////////////////////////////////////////////////// // CActionProgressDlg // This is the update window the Action Engine // Handles receiving of the error and update messages // Also catches events from host program class CActionProgressDlg : public CDialogImplEx, public IDispEventImpl<0, CActionProgressDlg, &DIID_DShutdownEvents, &LIBID_NightSecShutdown, 2, 5> { public: // Construction CActionProgressDlg(IUnknown* pSite, UINT nIDD); ~CActionProgressDlg(); // Catch Cancel Events BEGIN_SINK_MAP(CActionProgressDlg) SINK_ENTRY_EX(0, DIID_DShutdownEvents, 1, OnCancelEv) END_SINK_MAP() // Message Map BEGIN_MSG_MAP(CActionProgressDlg) MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) MESSAGE_HANDLER(WM_DESTROY, OnDestroy) MESSAGE_HANDLER(NSM_UPDATE, OnUpdateFile) MESSAGE_HANDLER(NSM_ERROR, OnError) COMMAND_ID_HANDLER(IDCANCEL, OnCancel) 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 OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); // Message from Action Engine LRESULT OnUpdateFile(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); // Called in response to the button being pressed, window being closed, or // event being fired LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); // Called when event Fired STDMETHOD(OnCancelEv)(); // Message from CActionEngine LRESULT OnError(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); bool PlayAmination(UINT nID); protected: bool m_bCancel; // True when cancelled, but not stopped CProgressBarCtrl m_ctlProgress; // Progress Bar IUnknownPtr m_pUnk; // Pointer from IObjectWithSite INightSecErrorLogPtr m_pErrorLog; // ErrorLog on same object as m_pUnk }; #endif //__ProgressDLG_H_