www.pudn.com > ShortCutEx.rar > CSCToolBar.h, change:2004-08-10,size:2619b
//CSCToolBar.h : Declaration of the CCSCToolBar //***************************************************************************// // // // This file was created using the CWindowImpl ATL Object Wizard // // By Erik Thompson © 2000 // // Version 1.1 // // Email questions and comments to ErikT@RadBytes.com // // // //***************************************************************************// #ifndef __CSCTOOLBAR_H_ #define __CSCTOOLBAR_H_ #include <commctrl.h> #include "DropTargetToolBar.h" ///////////////////////////////////////////////////////////////////////////// // CCSCToolBar class CCSCToolBar : public CWindowImpl<CCSCToolBar> { public: CCSCToolBar(); virtual ~CCSCToolBar(); DECLARE_WND_SUPERCLASS(TEXT("CSTOOLBAR"), TOOLBARCLASSNAME) // DECLARE_WND_CLASS(TOOLBARCLASSNAME) BEGIN_MSG_MAP(CCSCToolBar) MESSAGE_HANDLER(WM_CREATE, OnCreate) MESSAGE_HANDLER(WM_SIZE, OnSize) MESSAGE_HANDLER(WM_COMMAND, OnCommand) // NOTIFY_ID_HANDLER(1000, OnTrash) MESSAGE_HANDLER(WM_NOTIFY,OnNotify) 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); public: LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); // LRESULT OnTrash(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); LRESULT OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); public: int AddFile(LPCSTR lpcFile, BOOL bSave, LPCSTR lpcDiscription = NULL); int LoadSetting(); int SaveSetting(); private: HIMAGELIST m_hImageList; CDropTargetToolBar* m_pDropTarget; typedef struct _ToolBarItem { TCHAR chFilePath[MAX_PATH]; int nImageIndex; int nCommandIndex; int nTrashButton; HICON hBitmap; _ToolBarItem () { memset( chFilePath, 0, MAX_PATH); nImageIndex = nCommandIndex = nTrashButton = 0; hBitmap = NULL; } }ToolBarItem; CSimpleArray<ToolBarItem > m_Items; DWORD m_dwCommandIndex; }; #endif //__CSCTOOLBAR_H_