|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Member
Iscritto dal: Jul 2001
Città: Riccione
Messaggi: 74
|
[VB6] Aiuto please!!
avrei bisogno di caricare quella finestra di windows dove ti premette di selezionare una cartella, o un file. so che si può ma non so come. potete aiutarmi?
tnx |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Aug 2002
Città: Biella
Messaggi: 1882
|
Devi selezionare il componenete Microsoft Common Dialog
Dopo di che ci sono delle funzioncine tipo OPEN, SAVE, PRINT e altre...se paciocchi un pochino vedi che trovi tutto e di +!! :P |
![]() |
![]() |
![]() |
#4 | |
Senior Member
Iscritto dal: Aug 2002
Città: Biella
Messaggi: 1882
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#5 | |
Senior Member
Iscritto dal: Feb 2002
Messaggi: 7
|
Quote:
__________________
TORBIDA NULLAFACIENZA SEMIPRONA MENTECATTA |
|
![]() |
![]() |
![]() |
#6 |
Senior Member
Iscritto dal: Jul 2002
Città: Napoli
Messaggi: 1964
|
Si esatto non permette di selezionare le cartelle la Commondialog . Per le cartelle dovresti utilizzare il DirListBox .
|
![]() |
![]() |
![]() |
#7 |
Senior Member
Iscritto dal: Aug 2002
Città: Biella
Messaggi: 1882
|
Dovresti utilizzare la funzione API BrowseForFolder, quello ti apre solo le cartelle e con le dovute flag anche i file:
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 |
![]() |
![]() |
![]() |
#8 |
Senior Member
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
|
Mitici quelli di AllAPI... Peccato che non sviluppino più API-Guide
![]() |
![]() |
![]() |
![]() |
#9 |
Senior Member
Iscritto dal: Aug 2002
Città: Biella
Messaggi: 1882
|
E si, è un vero peccato
![]() |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 00:19.