Click here to Skip to main content
15,881,657 members
Articles / Desktop Programming / Windows Forms

An All VB.NET Explorer Tree Control with ImageList Management

Rate me:
Please Sign up or sign in to vote.
4.87/5 (138 votes)
17 May 2012CPOL30 min read 2.1M   29.5K   269  
Explorer TreeView control with Shell Folder access class and Icon management.
<?xml version="1.0"?>
<doc>
<assembly>
<name>
ExpTreeLib
</name>
</assembly>
<members>
<member name="P:ExpTreeLib.StringLogicalComparer.Default">
	<summary>
 Returns an Instance of StringLogicalComparer
 </summary>
	<returns>an Instance of StringLogicalComparer</returns>
</member><member name="M:ExpTreeLib.StringLogicalComparer.Compare(System.Object,System.Object)">
	<summary>
 Compares two Objects which must be Strings. Allows for and Compares properly if one or both Strings are Nothing. 
 <para>When given two initialized Strings, Compares them using 
 <see cref="ExpTreeLib.StringLogicalComparer.CompareStrings">the CompareStrings function of this Class</see></para>
	</summary>
	<param name="x">First String to Compare</param>
	<param name="y">Second String to Compare</param>
	<returns>Negative value if x less than y, 0 if x=y, or a positive value if x greater than y</returns>
	<remarks></remarks>
</member><member name="M:ExpTreeLib.StringLogicalComparer.CompareStrings(System.String,System.String)">
	<summary>
 Compares string such that strings containing numeric values will, assuming that non-numeric leading portions
 are equal, will sort in numeric order. Specifically, the strings: "a1", "a101", "a3" will sort as:
 "a1", "a3", "a101"
 </summary>
	<param name="s1">First String to Compare</param>
	<param name="s2">Second String to Compare</param>
	<returns>Negative value if s1 less than s2, 0 if s1=s2, positive value if s1 greater than s2</returns>
	<remarks>Note that negative return values may be other than -1 and that positive return values may be other than 1</remarks>
</member><member name="T:ExpTreeLib.StringLogicalComparer">
	<summary>
 Compares string such that strings containing numeric values will, assuming that non-numeric leading portions
 are equal, will sort in numeric order. Specifically, the strings: "a1", "a101", "a3" will sort as:
 "a1", "a3", "a101"
 </summary>
	<remarks><list type="bullet">
			<item><description>Article, code, and forum additions are found at:</description></item>
			<item><description>http://www.codeproject.com/cs/algorithms/csnsort.asp</description></item>
			<item><description>Original C# code by Vasian Cepa</description></item>
			<item><description>Optimized C# code by Richard Deeming</description></item>
			<item><description>Translated to VB.Net by Mike Cattle</description></item>
			<item><description>Corrected version of CompareNumbers by Jim Parsells</description></item>
		</list>
	</remarks>
</member><member name="M:ExpTreeLib.SystemImageListManager.Initializer">
	<summary>
 Summary of Initializer.
 </summary>
</member><member name="M:ExpTreeLib.SystemImageListManager.GetIconIndex(ExpTreeLib.CShItem@,System.Boolean,System.Boolean)">
	<summary>
 Summary of GetIconIndex.
 </summary>
	<param name="item"></param>
	<param name="GetOpenIcon"></param>
</member><member name="M:ExpTreeLib.SystemImageListManager.GetIcon(System.Int32,System.Boolean)">
	<summary>
 Returns a GDI+ copy of the icon from the ImageList
 at the specified index.</summary>
	<param name="Index">The IconIndex of the desired Icon</param>
	<param name="smallIcon">Optional, default = False. If True, return the
   icon from the Small ImageList rather than the Large.</param>
	<returns>The specified Icon or Nothing</returns>
</member><member name="M:ExpTreeLib.SystemImageListManager.SetListViewImageList(System.Windows.Forms.ListView,System.Boolean,System.Boolean)">
	<summary>
 Summary of SetListViewImageList.
 </summary>
	<param name="listView"></param>
	<param name="forLargeIcons"></param>
	<param name="forStateImages"></param>
</member><member name="M:ExpTreeLib.SystemImageListManager.SetTreeViewImageList(System.Windows.Forms.TreeView,System.Boolean)">
	<summary>
 Summary of SetTreeViewImageList.
 </summary>
	<param name="treeView"></param>
	<param name="forStateImages"></param>
</member><member name="M:ExpTreeLib.CProcDataObject.#ctor(System.Windows.Forms.DataObject@)">
	<Summary>Constructor starting with a .Net Data object
 .Net DataObjects are easy to work with, but are useless
 if the Dragged items are non-FileSystem
 The DragWrapper class will never call this.
 It is here for playing around with the CDragWrapper class
 </Summary>
</member><member name="M:ExpTreeLib.CProcDataObject.#ctor(System.IntPtr@)">
	<Summary>This constructor takes a pointer to an IDataObject obtained from a
 IDropTarget Interface's DragEnter method.
 If the pointer points to a .Net DataObject (which only happens within the same app),
 convert it and call ProcessNetDataObject
 Otherwise, it from another app, possibly Win Explorer, so
 check it for the required formats and build m_DragList.
 Any error just quits, leaving m_IsValid as False ... Caller must check
</Summary>
</member><member name="M:ExpTreeLib.CProcDataObject.ProcessCOMIDataObject(ExpTreeLib.ShellDll.IDataObject)">
	<Summary>Given an IDataObject from some non-net source, Build the 
 m_DragList ArrayList. 
 Also ensure that the IDataObject has "Shell IDList Array" formatted data
 If not, build it in m_StreamCIDA, if so, copy to m_StreamCIDA
If dealing with all FileSystem Items,
 </Summary>
</member><member name="M:ExpTreeLib.CProcDataObject.MakeShellIDArray(System.Collections.ArrayList)">
	<Summary>
 Shell Folders prefer their IDragData to contain this format which is
  NOT directly supported by .Net.  The underlying structure is the CIDA structure
  which is basically VB and VB.Net Hostile.
If "Make ShortCut(s) here" is the desired or
  POSSIBLE effect of the drag, then this format is REQUIRED -- otherwise the
  Folder will interpret the DragDropEffects.Link to be "Create Document Shortcut"
  which is NEVER the desired effect in this case
 The normal CIDA contains the Absolute PIDL of the source Folder and 
  Relative PIDLs for each Item in the Drag. 
  I cheat a bit an provide the Absolute PIDL of the Desktop (00, a short)
  and the Absolute PIDLs for the Items (all such Absolute PIDLS ar 
  relative to the Desktop.
</Summary>
	<Credit>http://www.dotnetmonster.com/Uwe/Forum.aspx/dotnet-interop/3482/Drag-and-Drop
  The overall concept and much code taken from the above reference
 Dave Anderson's response, translated from C# to VB.Net, was the basis
 of this routine
 An AHA momemnt and a ref to the above url came from
http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=61324%26lngWId=1

</Credit>
</member><member name="M:ExpTreeLib.CProcDataObject.MakeStreamFromCIDA(System.IntPtr)">
	<Summary>Given an IntPtr pointing to a CIDA,
 copy the CIDA to a new MemoryStream</Summary>
</member><member name="M:ExpTreeLib.CProcDataObject.MakeDragListFromCIDA">
	<Summary>Builds m_DragList from m_StreamCIDA</Summary>
	<returns> True if Successful, otherwise False</returns>
</member><member name="T:ExpTreeLib.CProcDataObject">
	<Summary>This class takes the IDataObject or .Net DataObjectpassed into DragEnter
  and builds a IDataObject that is suitable for use when interacting with the
 IDropTarget of a Folder.
Requirements:
  The input IDataObject must contain at least one of the following Formats and Data
   1. An ArrayList of CShItems
   2. A Shell IDList Array
   3. A FileDrop structure
 A Valid instance of this class will have and expose
  1. Dobj -- A COM IDataObject suitable for use in interaction with a Folder's IDropTarget
             Dobj will have, at least, a valid Shell IDList Array representing the Dragged Items
  2. DragData -- An ArrayList of 1 or more CShItems representing the Dragged Items
Processing Steps:
  1. Check for presence of one or more of the required Formats with valid Data
  2. Build or use the provided ArrayList of CShItems
  3. Ensure that all items are of same FileSystem/Non-FileSystem classification
  4. Build or use the provided Shell IDList Array 
  (Note that we don't necessarily build the FileDrop structure)
  5. if classification is FileSystem 
  5a.   Store Shell IDList Array into DataObject, if not already there
  5b.   Obtain COM IDataObject
  6, Else for non-FileSystem classification
  6a.   Obtain the IDataObject of the Virtual Folder  (A COM object)
  6b.   Store Shell IDList Array into that Object
  7. If no errors to this point, set m_IsValid to True
  8. Done
 The class also contains a number of useful shared methods for dealing with
 IDataObject 
 </Summary>
</member><member name="M:ExpTreeLib.ExpTree.RefreshTree(ExpTreeLib.CShItem)">
	<Summary>RefreshTree Method thanks to Calum McLellan</Summary>
</member><member name="M:ExpTreeLib.ExpTree.MakeNode(ExpTreeLib.CShItem)">
	<summary>
 Creates a TreeNode whose .Text is the DisplayName of the CShItem.<br/>
 Sets the IconIndexes for that TreeNode from the CShItem.<br/>
 Sets the Tag of the TreeNode to the CShItem<br/>
 If the CShItem (a Folder) has or may have sub-Folders (see Remarks), adds a Dummy node to
   the TreeNode's .Nodes collection. This is always done if the input CShItem represents a Removable device. Checking
   further on such devices may cause unacceptable delays.
 Returns the complete TreeNode.
 </summary>
	<param name="item">The CShItem to make a TreeNode to represent.</param>
	<returns>A TreeNode set up to represent the CShItem.</returns>
	<remarks>
 This routine will not be called if the CShItem (a Folder) is Hidden and ExpTree's ShowHidden Property is False.<br/>
 If the Folder is Hidden and ShowHidden is True, then this routine will be called.<br/>
 If the Folder is Hidden and it only contains Hidden Folders (files are not considered here), then, 
 the HasSubFolders attribute may be returned False even though Hidden Folders exist. In that case, we 
 must make an extra check to ensure that the TreeNode is expandable.<br/>
 
 There are additional complication with HasSubFolders. 
 <ul>
			<li>
 On XP and earlier systems, HasSubFolders was always
 returned True if the Folder was on a Remote system. On Vista and above, the OS would check and return an 
 accurate value. This extra check can take a long time on Remote systems - approximately the same amount of time as checking
 item.GetDirectories.Count. Versions 2.12 and above of ExpTreeLib have a modified HasSubFolders Property which will always
 return True if the Folder is on a Remote system, restoring XP behavior.</li>
			<li>
 On XP and earlier systems, compressed files (.zip, .cab, etc) were treated as files. On Vista and above, they are treated
 as Folders. ExpTreeLib continues to treat such files as files. The HasSubFolder attribute will report a Folder which
 contains only compressed files as True. In MakeNode, I simply accept the Vista and above interpretation, setting a dummy
 node in such a Folder. An attempt to expand such a TreeNode will just turn off the expansion marker.
 </li>
		</ul>
	</remarks>
</member><member name="M:ExpTreeLib.ExpTree.tv1_VisibleChanged(System.Object,System.EventArgs)">
	<Summary>When a form containing this control is Hidden and then re-Shown,
 the association to the SystemImageList is lost.  Also lost is the
 Expanded state of the various TreeNodes. 
 The VisibleChanged Event occurs when the form is re-shown (and other times
  as well).  
 We re-establish the SystemImageList as the ImageList for the TreeView and
 restore at least some of the Expansion.</Summary>
</member><member name="M:ExpTreeLib.ExpTree.tv1_BeforeCollapse(System.Object,System.Windows.Forms.TreeViewCancelEventArgs)">
	<Summary>Should never occur since if the condition tested for is True,
 the user should never be able to Collapse the node. However, it is
 theoretically possible for the code to request a collapse of this node
 If it occurs, cancel it</Summary>
</member><member name="M:ExpTreeLib.ExpTree.FindAncestorNode(ExpTreeLib.CShItem)">
	<Summary>Given a CShItem, find the TreeNode that belongs to the
 equivalent (matching PIDL) CShItem's most immediate surviving ancestor.
  Note: referential comparison might not work since there is no guarantee
 that the exact same CShItem is stored in the tree.</Summary>
	<returns> Me.Root if not found, otherwise the Treenode whose .Tag is
 equivalent to the input CShItem's most immediate surviving ancestor </returns>
</member><member name="M:ExpTreeLib.ExpTree.DragWrapper_ShDragEnter(System.Collections.ArrayList,System.IntPtr,System.Int32,System.Int32)">
	<Summary>ShDragEnter does nothing. It is here for debug tracking</Summary>
</member><member name="M:ExpTreeLib.ExpTree.DragWrapper_ShDragLeave">
	<Summary>Drag has left the control. Cleanup what we have to</Summary>
</member><member name="M:ExpTreeLib.ExpTree.DragWrapper_ShDragOver(System.Object,System.Drawing.Point,System.Int32,System.Int32)">
	<Summary>ShDragOver manages the appearance of the TreeView.  Management of
 the underlying FolderItem is done in DragWrapper
 Credit to Cory Smith for TreeView colorizing technique and code,
 at http://addressof.com/blog/archive/2004/10/01/955.aspx
 Node expansion based on expandNodeTimer added by me.
</Summary>
</member><member name="M:ExpTreeLib.ShellDll.SHGetNewLinkInfo(System.String,System.String,System.Text.StringBuilder,System.Boolean@,ExpTreeLib.ShellDll.SHGNLI)">
	<Summary>Despite its name, the API returns a filename
 for a link to be copied/created in a Target directory,
 with a specific LinkTarget. It will create a unique name
 unless instructed otherwise (SHGLNI_NOUNIQUE).  And add
 the ".lnk" extension, unless instructed otherwise(SHGLNI.NOLNK)
</Summary>
</member><member name="M:ExpTreeLib.ShellDll.SHGetNewLinkInfo(System.IntPtr,System.String,System.Text.StringBuilder,System.Boolean@,ExpTreeLib.ShellDll.SHGNLI)">
	<Summary> Same function using a PIDL as the pszLinkTo.
  SHGNLI.PIDL must be set.
</Summary>
</member><member name="M:ExpTreeLib.CShItem.Dispose">
	<summary>
 Summary of Dispose.
 </summary>
</member><member name="M:ExpTreeLib.CShItem.Dispose(System.Boolean)">
	<summary>
 Deallocates CoTaskMem contianing m_Pidl and removes reference to m_Folder
 </summary>
	<param name="disposing"></param>
</member><member name="M:ExpTreeLib.CShItem.Finalize">
	<summary>
 Summary of Finalize.
 </summary>
</member><member name="M:ExpTreeLib.CShItem.#ctor(ExpTreeLib.ShellDll.IShellFolder,System.IntPtr,ExpTreeLib.CShItem)">
	<summary>
 Private Constructor, creates new CShItem from the item's parent folder and
  the item's PIDL relative to that folder.</summary>
	<param name="folder">the folder interface of the parent</param>
	<param name="pidl">the Relative PIDL of this item</param>
	<param name="parent">the CShitem of the parent</param>
</member><member name="M:ExpTreeLib.CShItem.#ctor">
	<summary>
 Private Constructor. Creates CShItem of the Desktop
 </summary>
</member><member name="M:ExpTreeLib.CShItem.#ctor(ExpTreeLib.ShellDll.CSIDL)">
	<summary>Create instance based on a non-desktop CSIDL.
 Will create based on any CSIDL Except the DeskTop CSIDL</summary>
	<param name="ID">Value from CSIDL enumeration denoting the folder to create this CShItem of.</param>
</member><member name="M:ExpTreeLib.CShItem.#ctor(System.String)">
	<summary>Create a new CShItem based on a Path Must be a valid FileSystem Path</summary>
	<param name="path"></param>
</member><member name="M:ExpTreeLib.CShItem.#ctor(System.Byte[],System.Byte[])">
	<Summary>Given a Byte() containing the Pidl of the parent
 folder and another Byte() containing the Pidl of the Item,
 relative to the Folder, Create a CShItem for the Item.
 This is of primary use in dealing with "Shell IDList Array" 
 formatted info passed in a Drag Operation
 </Summary>
</member><member name="M:ExpTreeLib.CShItem.IsValidPidl(System.Byte[])">
	<Summary>It is impossible to validate a PIDL completely since its contents
 are arbitrarily defined by the creating Shell Namespace.  However, it
 is possible to validate the structure of a PIDL.</Summary>
</member><member name="M:ExpTreeLib.CShItem.GetParentOf(System.IntPtr,System.IntPtr@)">
	<Summary>Returns both the IShellFolder interface of the parent folder
  and the relative pidl of the input PIDL</Summary>
	<remarks>Several internal functions need this information and do not have
 it readily available. GetParentOf serves those functions</remarks>
</member><member name="M:ExpTreeLib.CShItem.SetUpAttributes(ExpTreeLib.ShellDll.IShellFolder,System.IntPtr)">
	<summary>Get the base attributes of the folder/file that this CShItem represents</summary>
	<param name="folder">Parent Folder of this Item</param>
	<param name="pidl">Relative Pidl of this Item.</param>
</member><member name="M:ExpTreeLib.CShItem.ComputeSortFlag">
	<summary>Computes the Sort key of this CShItem, based on its attributes</summary>
</member><member name="M:ExpTreeLib.CShItem.CompareTo(System.Object)">
	<Summary> CompareTo(obj as object)
  Compares obj to this instance based on SortFlag-- obj must be a CShItem</Summary>
	<SortOrder>  (low)Disks,non-browsable System Folders,
              browsable System Folders, 
               Directories, Files, Nothing (high)</SortOrder>
</member><member name="P:ExpTreeLib.CShItem.SFGAO_Attributes">
	<summary>
 This instance's Shell Attributes as returned by Folder.GetAttributesOf
 </summary>
	<returns>This instance's Shell Attributes as returned by Folder.GetAttributesOf</returns>
	<remarks>Internal use only</remarks>
</member><member name="P:ExpTreeLib.CShItem.HasSubFolders">
	<summary>
 True if item is a Folder and has sub-Folders
 </summary>
	<returns>True if item is a Folder and has sub-Folders, False otherwise</returns>
	<remarks>Modified to make this attribute behave (with respect to Remote Folders) like XP, even on Vista/Win7.
 That is, any Remote Folder is reported as HasSubFolders = True. Local Folders are tested with the API call.
 On Vista/Win7, Compressed files (eg - .Zip, .Cab, etc) are considered sub Folders by this Property.
 This behavior is NOT modified to behave like XP.</remarks>
</member><member name="M:ExpTreeLib.CShItem.SetDispType">
	<summary>
 Set DisplayName, TypeName, and SortFlag when actually needed
 </summary>
</member><member name="M:ExpTreeLib.CShItem.FillDemandInfo">
	<summary>
 Obtains information available from FileInfo.
 </summary>
</member><member name="P:ExpTreeLib.CShItem.Attributes">
	<summary>
 This instance's Attributes as returned by FileSystemInfo
 </summary>
	<returns>This instance's Attributes as returned by FileSystemInfo</returns>
	<remarks></remarks>
</member><member name="P:ExpTreeLib.CShItem.IsReadOnly">
	<Summary>The IsReadOnly attribute causes an annoying access to any floppy drives
 on the system. To postpone this (or avoid, depending on user action),
 the attribute is only queried when asked for</Summary>
</member><member name="P:ExpTreeLib.CShItem.IsSystem">
	<Summary>The IsSystem attribute is seldom used, but required by DragDrop operations.
 Since there is no way of getting ONLY the System attribute without getting
 the RO attribute (which forces a reference to the floppy drive), we pay
 the price of getting its own File/DirectoryInfo for this purpose alone.
</Summary>
</member><member name="M:ExpTreeLib.CShItem.GetDeskTop">
	<summary>
 If not initialized, then build DesktopBase
 once done, or if initialized already,
 </summary>
	<returns>The DesktopBase CShItem representing the desktop</returns>
</member><member name="M:ExpTreeLib.CShItem.IsAncestorOf(ExpTreeLib.CShItem,ExpTreeLib.CShItem,System.Boolean)">
	<Summary>IsAncestorOf returns True if CShItem ancestor is an ancestor of CShItem current
 if OS is Win2K or above, uses the ILIsParent API, otherwise uses the
 cPidl function StartsWith.  This is necessary since ILIsParent in only available
 in Win2K or above systems AND StartsWith fails on some folders on XP systems (most
 obviously some Network Folder Shortcuts, but also Control Panel. Note, StartsWith
 always works on systems prior to XP.
 NOTE: if ancestor and current reference the same Item, both
 methods return True</Summary>
</member><member name="M:ExpTreeLib.CShItem.IsAncestorOf(System.IntPtr,System.IntPtr,System.Boolean)">
	<Summary> Compares a candidate Ancestor PIDL with a Child PIDL and
 returns True if Ancestor is an ancestor of the child.
 if fParent is True, then only return True if Ancestor is the immediate
 parent of the Child</Summary>
</member><member name="T:ExpTreeLib.CShItem.WalkAllCallBack">
	<Summary>The WalkAllCallBack delegate defines the signature of 
 the routine to be passed to DirWalker
 Usage:  dim d1 as new CshItem.WalkAllCallBack(addressof yourroutine)
   Callback function receives a CShItem for each file and Directory in
   Starting Directory and each sub-directory of this directory and
   each sub-dir of each sub-dir ....
</Summary>
</member><member name="M:ExpTreeLib.CShItem.AllFolderWalk(ExpTreeLib.CShItem,ExpTreeLib.CShItem.WalkAllCallBack,System.Int32,System.Int32)">
	<Summary>
 AllFolderWalk recursively walks down directories from cStart, calling its
   callback routine, WalkAllCallBack, for each Directory and File encountered, including those in
   cStart.  UserLevel is incremented by 1 for each level of dirs that DirWalker
  recurses thru.  Tag in an Integer that is simply passed, unmodified to the 
  callback, with each CShItem encountered, both File and Directory CShItems.
 </Summary>
	<param name="cStart"></param>
	<param name="cback"></param>
	<param name="UserLevel"></param>
	<param name="Tag"></param>
</member><member name="M:ExpTreeLib.CShItem.GetDirectories(System.Boolean)">
	<summary>
 Returns the Directories of this sub-folder as an ArrayList of CShitems
 </summary>
	<param name="doRefresh">Optional, default=True, Refresh the directories</param>
	<returns>An ArrayList of CShItems. May return an empty ArrayList if there are none.</returns>
	<remarks>revised to alway return an up-to-date list unless 
 specifically instructed not to (useful in constructs like:
 if CSI.RefreshDirectories then
     Dirs = CSI.GetDirectories(False)  ' just did a Refresh </remarks>
</member><member name="M:ExpTreeLib.CShItem.GetFiles">
	<summary>
 Returns the Files of this sub-folder as an
   ArrayList of CShitems
 Note: we do not keep the arraylist of files, Generate it each time
 </summary>
	<returns>An ArrayList of CShItems. May return an empty ArrayList if there are none.</returns>
</member><member name="M:ExpTreeLib.CShItem.GetFiles(System.String)">
	<summary>
 Returns the Files of this sub-folder, filtered by a filtering string, as an
   ArrayList of CShitems
 Note: we do not keep the arraylist of files, Generate it each time
 </summary>
	<param name="Filter">A filter string (for example: *.Doc)</param>
	<returns>An ArrayList of CShItems. May return an empty ArrayList if there are none.</returns>
</member><member name="M:ExpTreeLib.CShItem.GetItems">
	<summary>
 Returns the Directories and Files of this sub-folder as an
   ArrayList of CShitems
 Note: we do not keep the arraylist of files, Generate it each time
 </summary>
	<returns>An ArrayList of CShItems. May return an empty ArrayList if there are none.</returns>
</member><member name="M:ExpTreeLib.CShItem.GetFileName">
	<Summary>GetFileName returns the Full file name of this item.
  Specifically, for a link file (xxx.txt.lnk for example) the
  DisplayName property will return xxx.txt, this method will
  return xxx.txt.lnk.  In most cases this is equivalent of
  System.IO.Path.GetFileName(m_Path).  However, some m_Paths
  actually are GUIDs.  In that case, this routine returns the
  DisplayName</Summary>
</member><member name="M:ExpTreeLib.CShItem.RefreshDirectories">
	<Summary> A lower cost way of Refreshing the Directories of this CShItem</Summary>
	<returns> Returns True if there were any changes</returns>
</member><member name="M:ExpTreeLib.CShItem.ToString">
	<summary>
 Returns the DisplayName as the normal ToString value
 </summary>
</member><member name="M:ExpTreeLib.CShItem.DebugDump">
	<summary>
 Summary of DebugDump.
 </summary>
</member><member name="M:ExpTreeLib.CShItem.GetContents(ExpTreeLib.ShellDll.SHCONTF,System.Boolean)">
	<Summary>
 Returns the requested Items of this Folder as an ArrayList of CShitems
  unless the IntPtrOnly flag is set.  If IntPtrOnly is True, return an
  ArrayList of PIDLs.
</Summary>
	<param name="flags">A set of one or more SHCONTF flags indicating which items to return</param>
	<param name="IntPtrOnly">True to suppress generation of CShItems, returning only an
  ArrayList of IntPtrs to RELATIVE PIDLs for the contents of this Folder</param>
</member><member name="M:ExpTreeLib.CShItem.ItemIDSize(System.IntPtr)">
	<Summary>
 Get Size in bytes of the first (possibly only)
  SHItem in an ID list.  Note: the full size of
   the item is the sum of the sizes of all SHItems
   in the list!!
 </Summary>
	<param name="pidl"></param>
</member><member name="M:ExpTreeLib.CShItem.ItemIDListSize(System.IntPtr)">
	<summary>
 computes the actual size of the ItemIDList pointed to by pidl
 </summary>
	<param name="pidl">The pidl pointing to an ItemIDList</param>
	<returns> Returns actual size of the ItemIDList, less the terminating nulnul</returns>
</member><member name="M:ExpTreeLib.CShItem.PidlCount(System.IntPtr)">
	<summary>
 Counts the total number of SHItems in input pidl
 </summary>
	<param name="pidl">The pidl to obtain the count for</param>
	<returns> Returns the count of SHItems pointed to by pidl</returns>
</member><member name="M:ExpTreeLib.CShItem.GetLastID(System.IntPtr)">
	<Summary>GetLastId -- returns a pointer to the last ITEMID in a valid
 ITEMIDLIST. Returned pointer SHOULD NOT be released since it
 points to place within the original PIDL</Summary>
	<returns>IntPtr pointing to last ITEMID in ITEMIDLIST structure,
 Returns IntPtr.Zero if given a null pointer.
 If given a pointer to the Desktop, will return same pointer.</returns>
	<remarks>This is what the API ILFindLastID does, however IL... 
 functions are not supported before Win2K.</remarks>
</member><member name="M:ExpTreeLib.CShItem.concatPidls(System.IntPtr,System.IntPtr)">
	<summary>
 Concatenates the contents of two pidls into a new Pidl (ended by 00)
 allocating CoTaskMem to hold the result,
 placing the concatenation (followed by 00) into the
 allocated Memory,
 and returning an IntPtr pointing to the allocated mem
 </summary>
	<param name="pidl1">IntPtr to a well formed SHItemIDList or IntPtr.Zero</param>
	<param name="pidl2">IntPtr to a well formed SHItemIDList or IntPtr.Zero</param>
	<returns>Returns a ptr to an ItemIDList containing the 
   concatenation of the two (followed by the req 2 zeros
   Caller must Free this pidl when done with it</returns>
</member><member name="M:ExpTreeLib.CShItem.TrimPidl(System.IntPtr,System.IntPtr@)">
	<summary>
 Returns an ItemIDList with the last ItemID trimed off
  This is necessary since I cannot get SHBindToParent to work 
  It's purpose is to generate an ItemIDList for the Parent of a
  Special Folder which can then be processed with DesktopBase.BindToObject,
  yeilding a Folder for the parent of the Special Folder
  It also creates and passes back a RELATIVE pidl for this item
 </summary>
	<param name="pidl">A pointer to a well formed ItemIDList. The PIDL to trim</param>
	<param name="relPidl">BYREF IntPtr which will point to a new relative pidl
        containing the contents of the last ItemID in the ItemIDList
        terminated by the required 2 nulls.</param>
	<returns> an ItemIDList with the last element removed.
  Caller must Free this item when through with it
  Also returns the new relative pidl in the 2nd parameter
   Caller must Free this pidl as well, when through with it
</returns>
</member><member name="M:ExpTreeLib.CShItem.DumpPidl(System.IntPtr)">
	<summary>
 Dumps, to the Debug output, the contents of the mem block pointed to by
 a PIDL. Depends on the internal structure of a PIDL
 </summary>
	<param name="pidl">The IntPtr(a PIDL) pointing to the block to dump</param>
</member><member name="M:ExpTreeLib.CShItem.DumpHex(System.Byte[],System.Int32,System.Int32)">
	<Summary>Dump a portion or all of a Byte Array to Debug output</Summary>
	<param name="b">A single dimension Byte Array</param>
	<param name="sPos">Optional start index of area to dump (default = 0)</param>
	<param name="epos">Optional last index position to dump (default = end of array)</param>
	<Remarks>
	</Remarks>
</member><member name="T:ExpTreeLib.CShItem.TagComparer">
	<Summary> It is sometimes useful to sort a list of TreeNodes,
 ListViewItems, or other objects in an order based on CShItems in their Tag
 use this Icomparer for that Sort</Summary>
</member><member name="M:ExpTreeLib.CShItem.cPidl.ToPIDL">
	<Summary> Copy the contents of a byte() containing a pidl to
  CoTaskMemory, returning an IntPtr that points to that mem block
 Assumes that this cPidl is properly terminated, as all New 
 cPidls are.
 Caller must Free the returned IntPtr when done with mem block.
</Summary>
</member><member name="M:ExpTreeLib.CShItem.cPidl.Decompose">
	<Summary>Returns an object containing a byte() for each of this cPidl's
 ITEMIDs (individual PIDLS), in order such that obj(0) is
 a byte() containing the bytes of the first ITEMID, etc.
 Each ITEMID is properly terminated with a nulnul
</Summary>
</member><member name="M:ExpTreeLib.CShItem.cPidl.IsEqual(ExpTreeLib.CShItem.cPidl)">
	<Summary>Returns True if input cPidl's content exactly match the 
 contents of this instance</Summary>
</member><member name="M:ExpTreeLib.CShItem.cPidl.JoinPidlBytes(System.Byte[],System.Byte[])">
	<Summary> Join two byte arrays containing PIDLS, returning a 
 Byte() containing the resultant ITEMIDLIST. Both Byte() must
 be properly terminated (nulnul)
 Returns NOTHING if error
 </Summary>
</member><member name="M:ExpTreeLib.CShItem.cPidl.BytesToPidl(System.Byte[])">
	<Summary> Copy the contents of a byte() containing a pidl to
  CoTaskMemory, returning an IntPtr that points to that mem block
 Caller must free the IntPtr when done with it
</Summary>
</member><member name="M:ExpTreeLib.CShItem.cPidl.StartsWith(System.IntPtr,System.IntPtr)">
	<Summary>returns True if the beginning of pidlA matches PidlB exactly for pidlB's entire length</Summary>
</member><member name="M:ExpTreeLib.CShItem.cPidl.StartsWith(ExpTreeLib.CShItem.cPidl,ExpTreeLib.CShItem.cPidl)">
	<Summary>returns True if the beginning of A matches B exactly for B's entire length</Summary>
</member><member name="M:ExpTreeLib.CShItem.cPidl.StartsWith(ExpTreeLib.CShItem.cPidl)">
	<Summary>Returns true if the CPidl input parameter exactly matches the
 beginning of this instance of CPidl</Summary>
</member><member name="T:ExpTreeLib.CShItem.cPidl">
	<Summary>cPidl class contains a Byte() representation of a PIDL and
 certain Methods and Properties for comparing one cPidl to another</Summary>
</member>
</members>
</doc>

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
After 30+ years working in the IT field, mostly managing SysAdmins, I have retired. One of my hobbies returns me to programming, basically just to keep my hand in.

Comments and Discussions