reading out the path and comparing it with a stored path

The place for threads about version 1.x of TimoSoft ExplorerTreeView.
Post Reply
doubleudee
Cadet
Posts: 2
Joined: 11 Apr 2007, 14:14

reading out the path and comparing it with a stored path

Post by doubleudee »

I have just installed and tried to use your treeview (thanks) and i would like to know how I could do the following:-

1. Move directly to a pre-set directory (which will be a network drive, e.g "h:\savedfiles") and display all the items found in that directory in a listview.

2. If the user selects a different directory I want to be able to display this in a textbox.

so my questions are, how do I compare/set the directory for point 1, and how do I retrieve the directory for point 2.

thanks
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: Unterföhring
Contact:

Re: reading out the path and comparing it with a stored path

Post by TiKu »

Hi,
doubleudee wrote:1. Move directly to a pre-set directory (which will be a network drive, e.g "h:\savedfiles") and display all the items found in that directory in a listview.
Just set the Path property to "h:\savedfiles". There's nothing built-in to fill the listview automatically. You'll have to do this yourself using the Dir command of VB6, the FileSystemObject COM library, the FindFirstFile()-Win32-API function, the shell interfaces (IShellFolder and so on) or a similar approach.
doubleudee wrote:2. If the user selects a different directory I want to be able to display this in a textbox.
Use the SelectionChanged event (it may have a slightly different name, I can't look it up right now) and the Path property. Or if you always need a valid filesystem path (the Path property returns another kind of path if it thinks it fits better), you may want to try the ItemHandleToFSPath() method. This method requires the handle of the item for which you want to retrieve the path. The selected item's handle is retrieved through the SelectedItem property.

HTH
TiKu
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
doubleudee
Cadet
Posts: 2
Joined: 11 Apr 2007, 14:14

Post by doubleudee »

Many thanks
Post Reply