Re: Displaying Recycle bin true contents in ListView
- From: rellison <rellison@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 21 Oct 2007 17:00:00 -0700
Hi Larry..
I had never thought of loading the shell interface and looking thru it in
the object browser. Over the course of the next week I will try and see if I
can find any other information on the other properties to make it act like
the recycle bin.
I had thought about loading an explorer window but was trying to keep
everything contain within the application. I had used the file system object
to get the drives and folders but found it to slow. I load them now thru a
dirbox and filelistbox and it much improves the speed.
I really appreciate all the help you have given me. It got me on the right
path. and showed me things I would not have figured out....
Rick
"Larry Serflaten" wrote:
.
"rellison" <rellison@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote
I have been doing some research this morning and have found out how to
access other various folders also. The one thing I can not find what is the
name all of the properties
.name
.size
.ect
that is associated with each of the list.items
Do these change with each folder type or are they the same and if so what
are they. I would like to see what info is available for each type...
As you may have read by now, Windows Scripting Host (WSH) can be
used to access the properties of physical folders and files, but it does
provide support for the virtual folders (Recycle, Network, Control Panel, etc.)
To get at those you use the Windows Shell.
You can find the Windows Shell interface in your VB References list and use
the VB Object Browser to examine all of its methods and properties.
(Add a reference to: Microsoft Shell Controls and Automation)
In addition to those listed, folders and files have extended properties such as
Owner, Author, Title, Subject, et al. To get at those you need to call the
folder's GetDetailsOf function passing in the desired file name, and the index
of the extended property you want returned. For more info see:
http://www.microsoft.com/technet/scriptcenter/guide/sas_fil_lunl.mspx?mfr=true
Like you, I had a tough time finding the property names. I got as far as I did
using only VB's Object Browser, but it did not list the two interfaces I had
found. So, I posted what I had to let you take it from there. There are several
extended properties and you might examine them all to see if any have the
Recycler info you need to mimic the Recycle Bin display.
But can I suggest a different approach? For the physical folders you can
use WSH to provide your listing, but for the virtual folders, how about
lauching a new explorer instance and letting it display the contents? If you
want the user to select one or more files, you could support (OLE) Drag
and Drop. I guess it really depends on what your application's main
function is....
None the less, this might be a useful link as well:
(Enumerating Special Folders)
http://www.microsoft.com/technet/scriptcenter/guide/sas_fil_higv.mspx?mfr=true
Example usage:
Option Explicit
Private Enum VF
[= Virtual Folders]
ControlPanel = 3
PrintersAndFaxes = 4
Documents = 5
Recent = 8
RecycleBin = 10
NetPlaces = 18
Cookies = 33
End Enum
Private Sub Command1_Click()
OpenVFolder VF.RecycleBin
End Sub
Private Sub OpenVFolder(ID As VF)
Dim sa
Set sa = CreateObject("Shell.Application")
sa.Open ID
End Sub
LFS
- References:
- Re: Displaying Recycle bin true contents in ListView
- From: Larry Serflaten
- Re: Displaying Recycle bin true contents in ListView
- Prev by Date: Re: VB6 LISTBOX problem
- Next by Date: Re: OTsort of but not really, Nvidia issue that affects all apps.
- Previous by thread: Re: Displaying Recycle bin true contents in ListView
- Next by thread: Re: Displaying Recycle bin true contents in ListView
- Index(es):
Relevant Pages
|