Click to See Complete Forum and Search --> : Can anyone give me example of API : GetShortPathName in VB


Naveed Anis
February 15th, 2000, 01:41 AM
I do want to know it immediately.

Also if anyone can tell me,

is GetShortPathName an win32 api?

A problem stays like a challenge till
I find the solution to it.

Lothar Haensler
February 15th, 2000, 01:44 AM
here we go again :-)

option Explicit
private 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 l as Long
Dim strLong as string * 255
Dim strshort as string * 255
strLong = "c:\winnt\niagnt32_install.log"
l = GetShortPathName(strLong, strshort, len(strLong))
MsgBox strshort
End Sub

tested with NT 4 and VB 6