cs_Thib
Messages postés20Date d'inscriptionvendredi 4 mai 2001StatutMembreDernière intervention24 janvier 2004
-
26 juin 2002 à 10:22
cs_Thib
Messages postés20Date d'inscriptionvendredi 4 mai 2001StatutMembreDernière intervention24 janvier 2004
-
27 juin 2002 à 08:30
Comment savoir si un lecteur est partagé ? :question)
ca fait une semaine que je cherche................sans résultats %-6
Derrick soft
Messages postés97Date d'inscriptionjeudi 10 mai 2001StatutMembreDernière intervention20 juin 2005 26 juin 2002 à 22:40
Bonjour,
Le code si dessous fonctionne pour un répertoire, mais je ne l'ai pas test sur lecteur.
Type FILEINFO
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 FILEINFO, _
ByVal cbFileInfo As Long, _
ByVal uFlags As Long) As Long
Function IsShared(ByVal Folder As String) As Boolean
Dim sfi As FILEINFO
SHGetFileInfo Folder, 0, sfi, Len(sfi), SHGFI_ATTRIBUTES
IsShared = (sfi.dwAttributes And SFGAO_SHARE)
End Function