Test sdφlenφ adresß°e

Postup:
V modulu deklarujte:


Type SHFILEINFO
    hIcon As Long
    iIcon As Long
    dwAttributes As Long
    szDisplayName As String * MAX_PATH
    szTypeName As String * 80
End Type

Public Const SHGFI_ATTRIBUTES = &H800
Public Const SFGAO_SHARE = &H20000

Public Declare Function SHGetFileInfo Lib "shell32.dll" Alias "SHGetFileInfoA" _
    ( ByVal pszPath As String, ByVal dwFileAttributes As Long, _
    psfi As SHFILEINFO, ByVal cbFileInfo As Long, ByVal uFlags As Long) As Long

Po zavolßnφ funkce pak staΦφ otestovat hodnotu v poli dwAttributes.

Function IsFolderShared(ByVal folderName As String) As Boolean

    Dim sfi As SHFILEINFO

    SHGetFileInfo foldernName, 0, sfi, Len(sfi), SHGFI_ATTRIBUTES
    IsFolderShared = (sfi.dwAttributes And SFGAO_SHARE)

End Function

Zp∞t

Autor: The Bozena