Hide

SftDirectory 3.5 - ActiveX File/Folder Control

Display
Print

SftDirectory.FolderUsingIDL Property

Returns a SftDirectoryFolder object given a file/folder's absolute IDL.

Syntax

Get

VB.NETrefFolderObj = object.get_FolderUsingIDL(ByVal absoluteIDL As String, ByVal FindOnly As Boolean) As SftDirectoryFolder
VBSet refFolderObj = object.FolderUsingIDL(ByVal absoluteIDL As String, ByVal FindOnly As Boolean) As SftDirectoryFolder
C#.NETSftDirectoryFolder refFolderObj = object.get_FolderUsingIDL(string absoluteIDL, bool FindOnly);
VC++ISftDirectoryFolder* refFolderObj = object->FolderUsingIDL[_bstr_t absoluteIDL][VARIANT_BOOL FindOnly];
ISftDirectoryFolder* refFolderObj = object->GetFolderUsingIDL(_bstr_t absoluteIDL, VARIANT_BOOL FindOnly);
CHRESULT object->get_FolderUsingIDL(BSTR absoluteIDL, VARIANT_BOOL FindOnly, ISftDirectoryFolder** refFolderObj);

object

A SftDirectory object.

absoluteIDL

A string value representing an ITEMIDLIST structure describing the absolute item ID of the folder to retrieve.

FindOnly

Defines whether the folder is located or added to the control.

FindOnlyDescription
TrueThe folder absoluteIDL is located within the presently loaded files and folders. If the file/folder is not found, Nothing (NULL) is returned.
FalseIf the specified file/folder absoluteIDL is not already present in the list, it is added to the control and all its parent folders are expanded. If the path is only partially valid, all valid initial folders are added and expanded. If the specified path is already present (even if part of a collapsed parent folder), its refFolderObj reference is returned. Parent folders are not expanded.

refFolderObj

Returns a SftDirectoryFolder object given a file/folder's absolute IDL.

Comments

The FolderUsingIDL property returns a SftDirectoryFolder object given a file/folder's absolute IDL.

If the specified path described by absoluteIDL cannot be found, the return value is Nothing (NULL).

The root folder cannot be located using the FolderUsingIDL property.

ITEMIDLIST structures are typically used when communicating with the Windows Shell. For detailed information about the ITEMIDLIST structure and its use, please see Microsoft's Windows documentation.

The Folder property can be used to retrieve a SftDirectoryFolder object given a path name.

Examples

VB.NET

    Dim IDL As String
    ' we're about to open a file/folder.  If we can add the folder on the
    ' left side, that means we don't need to open it in a separate window

    IDL = e.folder.ItemIDList ' the folder we are looking for
    ' this will add the complete hierarchy down to the folder in
    ' left tree (if possible)
    On Error Resume Next
    F = AxSftDirectoryLeft.get_FolderUsingIDL(IDL, False)
    On Error GoTo 0
    ' this will locate the exact item if we just added it
    F = AxSftDirectoryLeft.get_FolderUsingIDL(IDL, True)
    If Not F Is Nothing Then
        ' The folder has been added on the left side
        F.MakeCurrent() ' make it the current item
        F.MakeVisible() ' make sure it's scrolled into view

VB6

    Dim IDL As String
    ' we're about to open a file/folder.  If we can add the folder on the
    ' left side, that means we don't need to open it in a separate window

    IDL = Folder.ItemIDList ' the folder we are looking for
    ' this will add the complete hierarchy down to the folder in
    ' left tree (if possible)
    On Error Resume Next
    Set F = SftDirectoryLeft.FolderUsingIDL(IDL, False)
    On Error GoTo 0
    ' this will locate the exact item if we just added it
    Set F = SftDirectoryLeft.FolderUsingIDL(IDL, True)
    If Not F Is Nothing Then
        ' The folder has been added on the left side
        F.MakeCurrent ' make it the current item
        F.MakeVisible ' make sure it's scrolled into view

C#

    SftDirectoryFolder f;
    String IDL;
    // we're about to open a file/folder.  If we can add the folder on the
    // left side, that means we don't need to open it in a separate window

    IDL = e.folder.ItemIDList; // the folder we are looking for
    // this will add the complete hierarchy down to the folder in
    // left tree (if possible)
    f = axSftDirectoryLeft.get_FolderUsingIDL(IDL, false);
    // this will locate the exact item if we just added it
    f = axSftDirectoryLeft.get_FolderUsingIDL(IDL, true);
    if (f != null) {
        // The folder has been added on the left side
        f.MakeCurrent(); // make it the current item
        f.MakeVisible(); // make sure it's scrolled into view
        e.allow = false; // no need to open it

C++

    // we're about to open a file/folder.  If we can add the folder on the
    // left side, that means we don't need to open it in a separate window

    bstrIDL = f->ItemIDList; // the folder we are looking for
    // this will add the complete hierarchy down to the folder in
    // left tree (if possible)
    ISftDirectoryFolderPtr FolderAdded;
    HRESULT hr = vDirLeft->get_FolderUsingIDL(bstrIDL, VARIANT_FALSE, &FolderAdded);

    // this will locate the exact item if we just added it
    ISftDirectoryFolderPtr FolderFound;
    hr = vDirLeft->get_FolderUsingIDL(bstrIDL, VARIANT_TRUE, &FolderFound);
    if (SUCCEEDED(hr) && FolderFound != NULL) {
        // The folder has been added on the left side
        FolderFound->MakeCurrent(); // make it the current item
        FolderFound->MakeVisible(); // make sure it's scrolled into view

See Also SftDirectory Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.