ShellTree.h
上传用户:yangzi5763
上传日期:2007-01-02
资源大小:239k
文件大小: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. #include <afxcmn.h>
  25. class CShellTree : public CTreeCtrl
  26. {
  27. // Construction
  28. public:
  29. CShellTree();
  30. // Attributes
  31. public:
  32.     BOOL m_bOutaHere;
  33. // Operations
  34. public:
  35.   static int CALLBACK TreeViewCompareProc(LPARAM, LPARAM, LPARAM);
  36. void PopulateTree();
  37. void FolderExpanding(NMHDR* pNMHDR, LRESULT* pResult);
  38. void FolderPopup(NMHDR* pNMHDR, LRESULT* pResult);
  39. BOOL FolderSelected(NMHDR* pNMHDR, LRESULT* pResult, CString &szFolderPath);
  40. void EnableImages();
  41. BOOL GetSelectedFolderPath(CString &szFolderPath);
  42. // Overrides
  43. // ClassWizard generated virtual function overrides
  44. //{{AFX_VIRTUAL(CShellTree)
  45. //}}AFX_VIRTUAL
  46. // Implementation
  47. public:
  48. virtual ~CShellTree();
  49. // Generated message map functions
  50. protected:
  51. void FillTreeView(LPSHELLFOLDER lpsf, LPITEMIDLIST  lpifq, HTREEITEM     hParent);
  52. int GetIcon(LPITEMIDLIST lpi, UINT uFlags);
  53. void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq, LPTV_ITEM lptvitem);
  54. BOOL DoTheMenuThing(HWND hwnd, LPSHELLFOLDER lpsfParent, LPITEMIDLIST  lpi, LPPOINT lppt);
  55.     // Functions that deal with PIDLs
  56.     LPITEMIDLIST ConcatPidls(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
  57.     LPITEMIDLIST GetFullyQualPidl(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi);
  58.     LPITEMIDLIST CopyITEMID(LPMALLOC lpMalloc, LPITEMIDLIST lpi);
  59.     BOOL GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST  lpi, DWORD dwFlags, LPTSTR lpFriendlyName);
  60.     LPITEMIDLIST CreatePidl(UINT cbSize);
  61.     UINT GetSize(LPCITEMIDLIST pidl);
  62.     LPITEMIDLIST Next(LPCITEMIDLIST pidl);
  63. //{{AFX_MSG(CShellTree)
  64. //}}AFX_MSG
  65. DECLARE_MESSAGE_MAP()
  66. };
  67. /////////////////////////////////////////////////////////////////////////////
  68. //{{AFX_INSERT_LOCATION}}
  69. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  70. #endif // !defined(AFX_SHELLTREE_H__6B1818E3_8ADA_11D1_B10E_40F603C10000__INCLUDED_)