CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 1999
    Posts
    60

    Can anyone give me example of API : GetShortPathName in VB

    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.

  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Can anyone give me example of API : GetShortPathName in VB

    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






Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured