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