Folder.GetDetailsOf method

Retrieves details about an item in a folder. For example, its size, type, or the time of its last modification.

Syntax

retVal = Folder.GetDetailsOf(
  vItem,
  iColumn
)

Parameters

vItem

Type: Variant

The item for which to retrieve the information. This must be a FolderItem object.

iColumn

Type: Integer

An Integer value that specifies the information to be retrieved. The information available for an item depends on the folder in which it is displayed. This value corresponds to the zero-based column number that is displayed in a Shell view. For an item in the file system, this can be one of the following values:

(0)

Retrieves the name of the item.

(1)

Retrieves the size of the item.

(2)

Retrieves the type of the item.

(3)

Retrieves the date and time that the item was last modified.

(4)

Retrieves the attributes of the item.

(-1)

Retrieves the info tip information for the item.

Return value

Type: BSTR*

String containing the retrieved detail.

Remarks

Note

Not all methods are implemented for all folders. For example, the ParseName method is not implemented for the Control Panel folder (CSIDL_CONTROLS). If you attempt to call an unimplemented method, a 0x800A01BD (decimal 445) error is raised.

 

Examples

The following example uses GetDetailsOf to retrieve the type of the file named Clock.avi. Proper usage is shown for JScript, VBScript, and Visual Basic.

JScript:

<script language="JScript">
    function fnGetDetailsOfJ()
    {
        var objShell = new ActiveXObject("shell.application");
        var objFolder = new Object;
        
        objFolder = objShell.NameSpace("C:\\WINDOWS");
        if (objFolder != null)
        {
            var objFolderItem = new Object;

            objFolderItem = objFolder.ParseName("clock.avi");
            if (objFolderItem != null)
            {
                var objInfo = new Object;

                objInfo = objFolder.GetDetailsOf(objFolderItem, 2);
            }
        }
    }
</script>

VBScript:

<script language="VBScript">
    function fnGetDetailsOfVB()
        dim objShell
        dim objFolder
        
        set objShell = CreateObject("shell.application")
        set objFolder = objShell.NameSpace("C:\WINDOWS")

        if (not objFolder is nothing) then
            dim objFolderItem

            set objFolderItem = objFolder.ParseName("clock.avi")

            if (not objFolderItem Is Nothing) then
                dim objInfo
                        
                objInfo = objFolder.GetDetailsOf(objFolderItem, 2)
            end if
            
            set objFolderItem = nothing
        end if
        
        set objFolder = nothing
        set objShell = nothing
    end function
</script>

Visual Basic:

Private Sub btnGetDetailsOf_Click()
    Dim objShell  As Shell
    Dim objFolder As Folder

    Set objShell = New Shell
    Set objFolder = objShell.NameSpace("C:\WINDOWS")
    
    If (Not objFolder Is Nothing) Then
        Dim objFolderItem As FolderItem
        Set objFolderItem = objFolder.ParseName("clock.avi")
   
        If (Not objFolderItem Is Nothing) Then
            Dim szItem As String
            szItem = objFolder.GetDetailsOf(objFolderItem, 2)
        End If
        
        Set objFolderItem = Nothing
    End If
    
    Set objFolder = Nothing
    Set objShell = Nothing
End Sub

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Shlobj_core.h (include Shldisp.h)
IDL
Shldisp.idl
DLL
Shell32.dll (version 4.71 or later)