From: Mike Williams on
"GS" <GS(a)discussions.microsoft.com> wrote in message
news:F9DDC05E-1A1C-4F7B-BAF5-9399C73C9089(a)microsoft.com...

> I would like to know if there's a way to force a path string
> to display full text instead of the truncated version that uses
> the tilde character.

You can use the GetLongPathname function:

Private Declare Function GetLongPathName Lib "kernel32.dll" _
Alias "GetLongPathNameA" (ByVal lpszShortPath As String, _
ByVal lpszLongPath As String, ByVal cchBuffer As Long) As Long

Private Function LongPath(ShortPath As String) As String
Dim s1 As String, p As Long
p = GetLongPathName(ShortPath, s1, p)
s1 = Space$(p)
p = GetLongPathName(ShortPath, s1, p)
If p <> 0 Then
LongPath = Left$(s1, p)
End If
End Function

Mike


From: MikeD on


"GS" <GS(a)discussions.microsoft.com> wrote in message
news:F9DDC05E-1A1C-4F7B-BAF5-9399C73C9089(a)microsoft.com...
> I would like to know if there's a way to force a path string to display
> full
> text instead of the truncated version that uses the tilde character.
>
> i.e.:
> force "C:\Progr~1\My Appli~1\"
> to display as
> "C:\Program Files\My Application\"
>
> Thanks in advance!


You're obviously getting short path names. The question is why. Post your
code that is getting this path. Or, use Kevin's example code to obtain the
long names. My point is that it's rare anymore that you'd get the short name
so I'd look into why. For example, if you're getting this from an API
function call, you might be using a old function and should instead be using
a different function.

--
Mike




From: GS on

My thanks to all! Nice to get a variety of solutions; -great for learning
this stuff.

Kind regards,
Garry
First  |  Prev  | 
Pages: 1 2
Prev: Adding a toolbar?
Next: Coming clean...