cs_gp91
Messages postés5Date d'inscriptionlundi 7 février 2005StatutMembreDernière intervention 7 juillet 2005
-
8 mars 2005 à 12:32
cs_rene38
Messages postés1858Date d'inscriptionsamedi 29 juin 2002StatutMembreDernière intervention17 octobre 2013
-
8 mars 2005 à 14:16
bonjour a tous j'ai un soucis lors du deploiemnt d'une petite application qui consiste à copier des fichiers sur le bureau, comment faire pour avoir un chemin generique pour que ça fonctionne sur n'importe quel ordinateur, et oui c'est le debut mais on s'accroche
cs_rene38
Messages postés1858Date d'inscriptionsamedi 29 juin 2002StatutMembreDernière intervention17 octobre 201311 8 mars 2005 à 14:16
Private Declare Function SHGetSpecialFolderPath Lib "Shell32.dll" Alias "SHGetSpecialFolderPathA" (ByVal hwndOwner As Long, ByVal lpszPath As String, ByVal nFolder As Long, ByVal fCreate As Long) As Long
Private Sub Command1_Click()
Dim Chemin As String, Réponse As Long, Bureau As String, Compteur As Integer
Chemin = Space(300)
Réponse = SHGetSpecialFolderPath(Me.hWnd, Chemin, 16, 0) '16 désigne le bureau
If (Réponse <> 0) Then
Chemin = Left(Chemin, InStr(Chemin, vbNullChar) - 1) 'on enlève le superflu
Else
End If
For Compteur = Len(Chemin) To 1 Step -1 ' on cherche le nom du bureau : Bureau ? Desktop ? ...
If Mid$(Chemin, Compteur, 1) = "" Then Exit For
Next Compteur
Bureau = Chemin
End Sub