Boite de dialogue Ouvrir Répertoire

Anksunamon Messages postés 12 Date d'inscription jeudi 23 janvier 2003 Statut Membre Dernière intervention 17 juin 2007 - 23 janv. 2003 à 16:25
cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 - 23 janv. 2003 à 16:42
Salut à tous...

Je cherche à afficher la boite de dialogue ouvrir un répertoire comme je l'ais déjà vus dans plusieurs programmes, mais apparement avec les commondialogue on ne peut pas...

Comment peut-on afficher cette boite de dialogue de sélection de dossier???

Merci à tous!!!!

2 réponses

BasicInstinct Messages postés 1470 Date d'inscription mardi 5 février 2002 Statut Membre Dernière intervention 20 octobre 2014 12
23 janv. 2003 à 16:41
c'est ca que tu cherche ??

Private Type BrowseInfo
hWndOwner As Long
pIDLRoot As Long
pszDisplayName As Long
lpszTitle As Long
ulFlags As Long
lpfnCallback As Long
lParam As Long
iImage As Long
End Type
Const BIF_RETURNONLYFSDIRS = 1
Const MAX_PATH = 260
Private Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal hMem As Long)
Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal lpString1 As String, ByVal lpString2 As String) As Long
Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As Long, ByVal lpBuffer As String) As Long
Private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/
'KPDTeam@Allapi.net
Dim iNull As Integer, lpIDList As Long, lResult As Long
Dim sPath As String, udtBI As BrowseInfo

With udtBI
'Set the owner window
.hWndOwner = Me.hWnd
'lstrcat appends the two strings and returns the memory address
.lpszTitle = lstrcat("C:", "")
'Return only if the user selected a directory
.ulFlags = BIF_RETURNONLYFSDIRS
End With

'Show the 'Browse for folder' dialog
lpIDList = SHBrowseForFolder(udtBI)
If lpIDList Then
sPath = String$(MAX_PATH, 0)
'Get the path from the IDList
SHGetPathFromIDList lpIDList, sPath
'free the block of memory
CoTaskMemFree lpIDList
iNull = InStr(sPath, vbNullChar)
If iNull Then
sPath = Left$(sPath, iNull - 1)
End If
End If

MsgBox sPath
End Sub

:clown) BasicInstinct :clown)
0
cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 129
23 janv. 2003 à 16:42
Il te suffit de la créer toi même ;-) Une simple feuille avec un contrôle Drive List Box et un contrôle Dir List Box fait amplement l'affaire !

DARK SIDIOUS
0
Rejoignez-nous