Click here to Skip to main content
15,885,366 members
Articles / Desktop Programming / MFC

"Browse For Folder" dialog alike with source

Rate me:
Please Sign up or sign in to vote.
4.60/5 (5 votes)
5 Sep 2001 114.8K   1.7K   38  
Shell interfaces in use. IShellFolder, IEnumIDList, etc.
// TreeNode.h: interface for the CTreeNode class.
//
// Written by Marat Bedretdinov (maratb@hotmail.com)
// Copyright (c) 2000.
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is 
// not sold for profit without the authors written consent, and 
// providing that this notice and the authors name is included. 
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability if it causes any damage whatsoever.
// It's free - so you get what you pay for.

#if !defined(AFX_TREENODE_H__85AFE5B5_749B_4B2A_8F0B_45421451759F__INCLUDED_)
#define AFX_TREENODE_H__85AFE5B5_749B_4B2A_8F0B_45421451759F__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "TreeVisitor.h"

interface ITreeNode  
{
public:
	                        ITreeNode();
	virtual                 ~ITreeNode();

   virtual   void           Accept(CTreeVisitor&) = 0;

   virtual   void	        Cleanup() = 0;

   virtual   void	        FindChildren() = 0;

   virtual   ITreeNode*     FindChild(const char*) = 0;

   virtual   ITreeNode*     FindImmediateChild(const char*, UINT) = 0;

   virtual   ITreeNode*     FindImmediateChild(LPITEMIDLIST*) = 0;

   virtual   ITreeNode*	    GetChild(unsigned long n) = 0;
   
   virtual unsigned long	GetChildrenN(LPITEMIDLIST) = 0;

   virtual unsigned long	GetChildrenN(const char*) = 0;

   virtual unsigned long	GetChildrenN() const = 0;

   virtual   ITreeNode*     GetParent() = 0;

   virtual   IShellFolder*  GetShellFolder() {return 0;}

   virtual   void	        SetFindDepth(unsigned long n) = 0;

   virtual   void           SetFilter(UINT) = 0;

   virtual   UINT           GetFilter() const = 0;

   virtual   bool	        IsSearched() const = 0;

   virtual   bool	        IsDirectory() const = 0;

   virtual   bool           IsSystemDirectory() const = 0;

   virtual   bool	        HasChildren() const = 0;

   virtual   const char*	GetName() = 0;

   virtual   const char*	GetNameDebug() = 0;

   virtual   const char*	GetPath() const = 0;

   virtual   bool			CompareUniqueID(void*) = 0;

   virtual   void*          GetRelativeUniqueId() const = 0;

   virtual   void*          GetFullUniqueId() const = 0;

   virtual   const SHFILEINFO&    GetSmallIcon() = 0;

   virtual   const SHFILEINFO&    GetSmallOpenIcon() = 0;

   virtual   int            operator==(const ITreeNode&) = 0;

   virtual   void           RunIt() = 0;
};

#endif // !defined(AFX_TREENODE_H__85AFE5B5_749B_4B2A_8F0B_45421451759F__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here



Comments and Discussions