vb.net windows api

Programming, for all ages and all languages.
Post Reply
engine252

vb.net windows api

Post by engine252 »

hi,
i'm trying to get the short file path in vb.net
i found a api to do that but the function only works in vb6 can some body help me plz.

Code: Select all

Declare Function GetShortPathName Lib "kernel32" Alias _
  "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal _
  lpszShortPath As String, ByVal cchBuffer As Long) As Long


Private Sub Command1_Click()
  Dim sFile As String, sShortFile As String * 67
  Dim lRet As Long

  CommonDialog1.ShowOpen
  sFile = CommonDialog1.filename
  lRet = GetShortPathName(sFile, sShortFile, Len(sShortFile))
  sFile = Left(sShortFile, lRet)
  Text1.Text = sFile
End Sub
i need the same for the GetFullPath api
Post Reply