API SHGetFileInfo

Résolu
Xaviou - 19 janv. 2000 à 17:22
dwarft Messages postés 8 Date d'inscription lundi 16 décembre 2002 Statut Membre Dernière intervention 5 décembre 2007 - 25 août 2003 à 16:52
Salut,
quelqu'un saurait-il comment utiliser l'API SHGetFileInfo ? Pour ma part, c'est le bide complet.

J'attends vos réponses avec impatience.

@+

Xaviou :o)

1 réponse

dwarft Messages postés 8 Date d'inscription lundi 16 décembre 2002 Statut Membre Dernière intervention 5 décembre 2007
25 août 2003 à 16:52
salut, un exemple simple (enfin je crois)
Private Type SHFILEINFO
hIcon As Long
iIcon As Long
dwAttributes As Long
szDisplayName As String * 260
szTypeName As String * 80
End Type

Private Const SHGFI_TYPENAME = &H400
Private Const SHGFI_LARGEICON = &H0&
Private Const SHGFI_SMALLICON = &H1&
Private Const SHGFI_OPENICON = &H2&
Private Const SHGFI_SHELLICONSIZE = &H4&
Private Const SHGFI_PIDL = &H8&
Private Const SHGFI_USEFILEATTRIBUTES = &H10&
Private Const SHGFI_ICON = &H100&
Private Const SHGFI_DISPLAYNAME = &H200&
Private Const SHGFI_ATTRIBUTES = &H800&
Private Const SHGFI_ICONLOCATION = &H1000&
Private Const SHGFI_EXETYPE = &H2000&
Private Const SHGFI_LINKOVERLAY = &H8000&

Private 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

Private Function TypeDeFichier (strFichier as string)
dim FileInfo as SHFILEINFO
SHGetFileInfo ByVal strFichier , 0&, FileInfo, Len(FileInfo), SHGFI_TYPENAME
TypeDeFichier = left(FileInfo.szTypeName ,instr(FileInfo.szTypeName ,chr(0))-1)
end function

voila bonne chance et @+
Dwarft
3
Rejoignez-nous