cs_RaZoR
Messages postés102Date d'inscriptionvendredi 22 février 2002StatutMembreDernière intervention22 décembre 2003
-
19 janv. 2003 à 19:19
gmni
Messages postés91Date d'inscriptionmercredi 6 novembre 2002StatutMembreDernière intervention20 mars 2009
-
14 mars 2003 à 00:55
Je voudrais savoir comment on fais pour ,avec un commondialog, pouvoir sélectionner un DOSSIER !!!
clementio
Messages postés432Date d'inscriptionsamedi 18 mai 2002StatutMembreDernière intervention17 février 20141 19 janv. 2003 à 22:03
Avec un commondialogbox tu peux pas mais essaie ça:
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Declare Function SHBrowseForFolder Lib "shell32.dll" Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
Private Const BIF_RETURNONLYFSDIRS = &H1
Private Type BROWSEINFO
hOwner As Long
pidlRoot As Long
pszDisplayName As String
lpszTitle As String
ulFlags As Long
lpfn As Long
lParam As Long
iImage As Long
End Type
Private Sub Command1_Click()
Dim X As BROWSEINFO
Dim Chemin As String
Dim pidl As Long
Dim RetVal As Long
Dim p As Integer
X.hOwner = Me.hwnd
X.pidlRoot = 0&
X.lpszTitle = "Selectionnez le dossier où commencer la recherche"
X.ulFlags = BIF_RETURNONLYFSDIRS
pidl& = SHBrowseForFolder(X)
Chemin = String(512, 0)
RetVal = SHGetPathFromIDList(pidl&, Chemin)
If RetVal Then
p = InStr(Chemin, Chr$(0))
Text1 = Left(Chemin, p - 1)
End If
End Sub