cs_Xime
Messages postés75Date d'inscriptionlundi 4 février 2002StatutMembreDernière intervention24 mars 2003
-
7 août 2002 à 10:23
clementio
Messages postés432Date d'inscriptionsamedi 18 mai 2002StatutMembreDernière intervention17 février 2014
-
7 août 2002 à 11:46
salut
j'aimerais savoir comment recuperer le chemin MS-DOS d'un fichier
clementio
Messages postés432Date d'inscriptionsamedi 18 mai 2002StatutMembreDernière intervention17 février 20141 7 août 2002 à 11:46
Voici un exemple tiré de l'API-Guide:
Déclaration de l'API:
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal lBuffer As Long) As Long
Ecriture de la fonction:
Public Function GetShortPath(strFileName As String) As String
Dim lngRes As Long, strPath As String
strPath = String$(165, 0)
lngRes = GetShortPathName(strFileName, strPath, 164)
GetShortPath = Left$(strPath, lngRes)
End Function
Appel de la fonction:
Private Sub Form_Load()
MsgBox GetShortPath("c:\Program Files")
End Sub