ShellTree.h
上传用户:louyoung
上传日期:2007-01-02
资源大小:123k
文件大小:3k
源码类别:

ActiveX/DCOM/ATL

开发平台:

Visual C++

  1. #if !defined(AFX_SHELLTREE_H__6B1818E3_8ADA_11D1_B10E_40F603C10000__INCLUDED_)
  2. #define AFX_SHELLTREE_H__6B1818E3_8ADA_11D1_B10E_40F603C10000__INCLUDED_
  3. #if _MSC_VER >= 1000
  4. #pragma once
  5. #endif // _MSC_VER >= 1000
  6. // ShellTree.h : header file
  7. //
  8. #include <shlobj.h>
  9. // STRUCTURES
  10. typedef struct tagLVID
  11. {
  12.    LPSHELLFOLDER lpsfParent;
  13.    LPITEMIDLIST  lpi;
  14.    ULONG         ulAttribs;
  15. } LVITEMDATA, *LPLVITEMDATA;
  16. typedef struct tagID
  17. {
  18.    LPSHELLFOLDER lpsfParent;
  19.    LPITEMIDLIST  lpi;
  20.    LPITEMIDLIST  lpifq;
  21. } TVITEMDATA, *LPTVITEMDATA;
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CShellTree window
  24. class CShellTree : public CTreeCtrl
  25. {
  26. // Construction
  27. public:
  28. CShellTree();
  29. // Attributes
  30. public:
  31.     BOOL m_bOutaHere;
  32. // Operations
  33. public:
  34.   static int CALLBACK TreeViewCompareProc(LPARAM, LPARAM, LPARAM);
  35. void PopulateTree();
  36. void FolderExpanding(NMHDR* pNMHDR, LRESULT* pResult);
  37. void FolderPopup(NMHDR* pNMHDR, LRESULT* pResult);
  38. BOOL FolderSelected(NMHDR* pNMHDR, LRESULT* pResult, CString &szFolderPath);
  39. void EnableImages();
  40. BOOL GetSelectedFolderPath(CString &szFolderPath);
  41. // Overrides
  42. // ClassWizard generated virtual function overrides
  43. //{{AFX_VIRTUAL(CShellTree)
  44. //}}AFX_VIRTUAL
  45. // Implementation
  46. public:
  47. virtual ~CShellTree();
  48. // Generated message map functions
  49. protected:
  50. void FillTreeView(LPSHELLFOLDER lpsf, LPITEMIDLIST  lpifq, HTREEITEM     hParent);
  51. int GetIcon(LPITEMIDLIST lpi, UINT uFlags);
  52. void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq, LPTV_ITEM lptvitem);
  53. BOOL DoTheMenuThing(HWND hwnd, LPSHELLFOLDER lpsfParent, LPITEMIDLIST  lpi, LPPOINT lppt);
  54.     // Functions that deal with PIDLs
  55.     LPITEMIDLIST ConcatPidls(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
  56.     LPITEMIDLIST GetFullyQualPidl(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi);
  57.     LPITEMIDLIST CopyITEMID(LPMALLOC lpMalloc, LPITEMIDLIST lpi);
  58.     BOOL GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST  lpi, DWORD dwFlags, LPSTR lpFriendlyName);
  59.     LPITEMIDLIST CreatePidl(UINT cbSize);
  60.     UINT GetSize(LPCITEMIDLIST pidl);
  61.     LPITEMIDLIST Next(LPCITEMIDLIST pidl);
  62. //{{AFX_MSG(CShellTree)
  63. //}}AFX_MSG
  64. DECLARE_MESSAGE_MAP()
  65. };
  66. /////////////////////////////////////////////////////////////////////////////
  67. //{{AFX_INSERT_LOCATION}}
  68. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  69. #endif // !defined(AFX_SHELLTREE_H__6B1818E3_8ADA_11D1_B10E_40F603C10000__INCLUDED_)