From: Jim Mack on 2 Feb 2010 22:10 Karl E. Peterson wrote: > GS explained : >> I'm using the following code, not a control: >> >> Label1.Caption = App.Path > > You gotta be kidding? What version of VB? What OS? I have a vague recollection that if VB is started from a shortcut using SFNs, that this will be one result. But it must be a pretty old recollection. -- Jim Mack Twisted tees at http://www.cafepress.com/2050inc "We sew confusion"
From: GS on 2 Feb 2010 22:23 Works great. Thanks so much! Garry "Mike Williams" wrote: > "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: GS on 2 Feb 2010 22:25 Works great. Thanks so much! Garry "C. Kevin Provance" wrote: > > "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\" > | > > This is kind of old school > > Public Function GetLongFilename(ByVal sShortName As String) As String > > Dim sLongName As String > Dim sTemp As String > Dim iSlashPos As Long > > sShortName = Replace(sShortName, """", vbNullString, 1) > sShortName = sShortName & "\" > > iSlashPos = InStr(4, sShortName, "\") > > While iSlashPos > sTemp = Dir(Left$(sShortName, iSlashPos - 1), vbNormal + vbHidden + > vbSystem + vbDirectory) > If sTemp = vbNullString Then > GetLongFilename = vbNullString > Exit Function > End If > sLongName = sLongName & "\" & sTemp > iSlashPos = InStr(iSlashPos + 1, sShortName, "\") > Wend > > GetLongFilename = Left$(sShortName, 2) & sLongName > > End Function > > > . >
From: GS on 2 Feb 2010 22:54 Hi Larry, Thanks! Works great. I saw this already and passed it over because 'Filename' was in it. After reviewing the other posts I'm now better informed about how it works. regards, Garry
From: GS on 2 Feb 2010 23:00
Karl, I don't get it either. My dev machine (XP Pro SP3) returns full text. My test machines (XP Pro SP2, Win7 64bit) return the truncated version. What's strange is that it only occurs in the labels on my splash and about dialogs. It shows full text everywhere else. I'm using VB6 SP6 Garry "Karl E. Peterson" wrote: > GS explained : > > I'm using the following code, not a control: > > > > Label1.Caption = App.Path > > You gotta be kidding? What version of VB? What OS? > > -- > ..NET: It's About Trust! > http://vfred.mvps.org > > > . > |