// SourceProp.h : Declaration of the CSourceProp #ifndef __SOURCEPROP_H_ #define __SOURCEPROP_H_ #include "resource.h" // main symbols #include "../common/cmptdata.h" #include #include #include #include #include ///////////////////////////////////////////////////////////////////////////// // CSourceProp: Base functionality for Night Sec File List Property Pages // With dragdrop, browse etc... class ATL_NO_VTABLE CSourceProp : // public CDialogImpl, public CDialogImplEx, public IDropTarget { public: CSourceProp() : CDialogImplEx(IDD_SOURCE) {} enum { IDD = IDD_SOURCE }; BEGIN_MSG_MAP(CSourceProp) MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) MESSAGE_HANDLER(WM_DESTROY, OnDestroy) MESSAGE_HANDLER(WM_SHOWWINDOW, OnShowWindow) NOTIFY_HANDLER(IDC_SOURCE_LIST, LVN_ENDLABELEDIT, OnEndLabelEdit) NOTIFY_HANDLER(IDC_SOURCE_LIST, NM_SETFOCUS, OnListSetFocus) NOTIFY_HANDLER(IDC_SOURCE_LIST, LVN_KEYDOWN, OnKeyDown) NOTIFY_HANDLER(IDC_SOURCE_LIST, LVN_ITEMCHANGED, OnChange) NOTIFY_HANDLER(IDC_SOURCE_LIST, LVN_INSERTITEM, OnChange) NOTIFY_HANDLER(IDC_SOURCE_LIST, LVN_DELETEITEM, OnChange) COMMAND_ID_HANDLER(IDC_ADD, OnAdd) COMMAND_ID_HANDLER(IDC_REMOVE, OnRemove) 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); LRESULT OnShowWindow(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnEndLabelEdit(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); LRESULT OnListSetFocus(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); LRESULT OnKeyDown(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); LRESULT OnChange(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); LRESULT OnRemove(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); LRESULT OnAdd(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); bool AddFile(string sFileName); protected: CSysImageList m_imgList; CListViewCtrl m_ctlList; string_array m_aPaths; void UpdateData(bool bSave = true); // IDropTarget public: STDMETHOD(DragEnter)(IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect); STDMETHOD(DragOver)(DWORD grfKeyState, POINTL pt, DWORD* pdwEffect) { return S_OK; } STDMETHOD(DragLeave)(void) { return S_OK; } STDMETHOD(Drop)(IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect); }; #endif //__SOURCEPROP_H_