SwList.h
资源名称:1731.rar [点击查看]
上传用户:swkcbjrc
上传日期:2016-04-02
资源大小:45277k
文件大小:4k
源码类别:
游戏
开发平台:
Visual C++
- ////////////////////////////////////////////////////////////////
- #if !defined(AFX_FAVORLIST_H__52EFAD4F_D1D7_11D4_BEC4_E6CA67B86945__INCLUDED_)
- #define AFX_FAVORLIST_H__52EFAD4F_D1D7_11D4_BEC4_E6CA67B86945__INCLUDED_
- /*//////////////////////////////////////////////////////////////
- Copyright(c) 2000, Masoud Samimi - All Rights Reserved.
- File: FavorList.h - header file of favorite list box
- History: Created 14/12/2000 (dd/mm/yyyy)
- Used for: Loads all your favorites URLs from the
- windows favorites directory "C:windowsfavorites"
- and adds/displays them inside the list box
- Deriving: This class can be used as a base class to your own
- derived class inorder to have your own specialized
- AddString(you rown stuff) by just overriding one
- virtual function, the PreSubclassWindow() funtion.
- Notes: This class and the code is freely destributed, you
- cannot sell it. You can modify to fit your own
- style, but you will have to mention your changes and
- your name here in the changes log below!
- Whatever you do, please do not remove this info header
- from the files.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Changes: ---->
- By: ---->
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ////////////////////////////////
- List of further enhancements:
- 1. To add all the subdiretctory URLs as well.
- 2. To add a tree control! if possible, to have
- the top level directories as expandable parents
- and the URLs files as children.
- ( Something like the Windows Explorer! )
- 3. Add your wishes! :)
- ////////////////////////////////
- ///////////////////////////////////////////////////////////////*/
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // FavorList.h : header file
- //
- /////////////////////////////////////////////////////////////////////////////
- // CMyToolTipCtrl
- class CMyToolTipCtrl : public CToolTipCtrl
- {
- // Construction
- public:
- CMyToolTipCtrl();
- // Attributes
- public:
- // Operations
- public:
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMyToolTipCtrl)
- //}}AFX_VIRTUAL
- // Implementation
- public:
- BOOL AddWindowTool (CWnd* pWnd, LPCTSTR pszText);
- virtual ~CMyToolTipCtrl();
- // Generated message map functions
- protected:
- //{{AFX_MSG(CMyToolTipCtrl)
- // NOTE - the ClassWizard will add and remove member functions here.
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- // CFavorList window
- class CFavorList : public CListBox
- {
- // Construction
- public:
- CFavorList();
- // Attributes
- protected:
- HCURSOR hCursor;
- CBrush backBrush; // brush of the background color
- CBrush OldBrush;
- CMyToolTipCtrl m_ctlTT;
- // Operations
- protected:
- int GetFavoritesDirectory();
- void LoadFiles();
- void EnumerateFolders ();
- unsigned char szFavoritesDir [MAX_PATH], m_strPath [MAX_PATH] ;
- char szBuffer [80];
- int iReturn;
- LONG lReturn;
- HKEY hKey;
- DWORD dwType, dwLength;
- WIN32_FIND_DATA fd;
- HANDLE hFind;
- protected:
- virtual void PreSubclassWindow();
- virtual HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
- // Implementation
- public:
- virtual ~CFavorList();
- // Generated message map functions
- protected:
- //{{AFX_MSG(CFavorList)
- afx_msg void OnSelchange();
- afx_msg void OnDestroy();
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnDblclk();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_FAVORLIST_H__52EFAD4F_D1D7_11D4_BEC4_E6CA67B86945__INCLUDED_)