kpfeu
Messages postés9Date d'inscriptionmardi 13 août 2002StatutMembreDernière intervention29 janvier 2003
-
14 août 2002 à 12:12
kpfeu
Messages postés9Date d'inscriptionmardi 13 août 2002StatutMembreDernière intervention29 janvier 2003
-
14 août 2002 à 19:07
Bonjour,
je suis débutant et ça fait plusieurs jours que je cherche à afficher la boite de dialogue "Rechercher un dossier" (la petite boîte, comme par exemple sous WinAce lorsqu'on à un SFX et que l'on veut l'extraire dans un autre dossier que celui proposé) et je n'est pas trouvé. Car j'aimerais que lorsque la personne xlique sur le bouton, la boîte s'affiche pour lui permettre de sélectionner un dossier pour extraire les informations vers ce dossier.
Si c"est possible et que quelqu'un à la solution SVP aidez moi.
stefsoft
Messages postés119Date d'inscriptionlundi 15 avril 2002StatutMembreDernière intervention28 novembre 2008 14 août 2002 à 12:47
le seul moyen que je connaisse c'est par l'API
voici un exemple :
place ce code dans un nouveau projet
'-------------------
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()
Dim iNull As Integer, lpIDList As Long, lResult As Long
Dim sPath As String, udtBI As BrowseInfo
With udtBI
.hWndOwner = Me.hWnd
.lpszTitle = lstrcat("C:", "")
.ulFlags = BIF_RETURNONLYFSDIRS
End With
'affiche la boite IDlist
lpIDList = SHBrowseForFolder(udtBI)
If lpIDList Then
sPath = String$(MAX_PATH, 0)
'retourne le path
SHGetPathFromIDList lpIDList, sPath
'libere le bloque memo
CoTaskMemFree lpIDList
iNull = InStr(sPath, vbNullChar)
If iNull Then
sPath = Left$(sPath, iNull - 1)
End If
End If