⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shelltreectrl.h

📁 类似 windows explorer的工具
💻 H
字号:
#if !defined(AFX_SHELLTREECTRL_H__98BDBB7B_E2C3_4145_A5D5_693274C6B99B__INCLUDED_)
#define AFX_SHELLTREECTRL_H__98BDBB7B_E2C3_4145_A5D5_693274C6B99B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ShellTreeCtrl.h : header file
//
/////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2000-2001 by Paolo Messina
// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
//
// The contents of this file are subject to the Artistic License (the "License").
// You may not use this file except in compliance with the License. 
// You may obtain a copy of the License at:
// http://www.opensource.org/licenses/artistic-license.html
//
// If you find this code useful, credits would be nice!
//
// Modified by truezq 2004-01
/////////////////////////////////////////////////////////////////////////////

//#include "WaitingTreeCtrl.h"
#include "Common\WaitingTreeCtrl.h"
#include "Common\ShellPidl.h"
#include "Common\ShellString.h"
#include "Common\ShellContextMenu.h"

/////////////////////////////////////////////////////////////////////////////
// CShellTreeCtrl window

class CShellTreeCtrl : public CWaitingTreeCtrl
{
//public:
private:
    static SDesktopFolderPtr m_pDesktopFolder; // Fixed by truezq
private:
    BOOL m_bIsUDisk; // TRUE:优盘 FALSE:非优盘,全部显示
private:
    
    //SDesktopFolderPtr m_pDesktopFolder;
    UINT m_nCallbackMask;
    
public:
    // U盘标记设置
    void SetUDiskTag(BOOL bIsUDisk)
    {
        m_bIsUDisk = bIsUDisk;
    }
    void GotoSubFolder(const CString& strFolderName);

private:
    
private:
    // generic
    void InitializeControl();
    
    BOOL EnumFolderItems(HTREEITEM hParent, LPCITEMIDLIST pidlParent, UINT nFlags);
    void InsertSubItem(HTREEITEM hParent, LPSHELLFOLDER pParentFolder, LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidl, UINT nFlags);
    void FillItem(TVITEM& item);
    
    static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
    
protected:
    virtual BOOL PopulateItem(HTREEITEM hParent);
    
    // Construction
public:
    CShellTreeCtrl();
    virtual ~CShellTreeCtrl();
    
    // Attributes
public:
    
    // Operations
public:
    
    // Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CShellTreeCtrl)
protected:
    virtual void PreSubclassWindow();
    //}}AFX_VIRTUAL
    
    // Implementation
public:
    UINT GetCallbackMask();
    void SetCallbackMask(UINT nMask);
    void AddRootItem(LPCITEMIDLIST pidl, UINT nFlags = STCF_DEFAULT);
    void AddRootFolderContent(LPCITEMIDLIST pidl, UINT nFlags = STCF_DEFAULT);
    CShellPidl GetItemIDList(HTREEITEM hItem);
    BOOL GetItemContextMenu(HTREEITEM hItem, CShellContextMenu &rCtxMenu);
    
    // Generated message map functions
protected:
    //{{AFX_MSG(CShellTreeCtrl)
    afx_msg void OnDeleteItem(NMHDR* pNMHDR, LRESULT* pResult);
    afx_msg void OnGetDispInfo(NMHDR* pNMHDR, LRESULT* pResult);
    //}}AFX_MSG
    
    DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SHELLTREECTRL_H__98BDBB7B_E2C3_4145_A5D5_693274C6B99B__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -