Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Netherlands
 Boudewijn Lutgerink
 To: Poppy Fdn
  Where is Poppy Fdn?
 Jakarta
 Indonesia
 Poppy Fdn
 Tags
Subject: RE: MS-Dos address
Thread ID: 245333 Message ID: 245340 # Views: 48 # Ratings: 2
Version: Visual FoxPro 9 Category: Other
Date: Wednesday, November 11, 2009 9:06:05 AM         
   


> Hi,
> Im looking for a way to show a file address in MS-Dos address format.
> eg : C:\program files\myFile.exe , shown as : C:\progra~1\myFile.exe
>
> I was knew how to do that, but then I forgot and I need it now.
>
> Thanks In Advanced

DECLARE INTEGER GetShortPathName IN kernel32;
    STRING    lpszLongPath,;
    STRING  @ lpszShortPath,;
    INTEGER   cchBuffer

cLongFileName = FULLPATH( "VFP9.exe" )
?m.clongfilename
cShortName = SPACE(1024)
?getshortpathName( m.clongfilename, @m.cshortname, len(m.cshortname) )
?m.cshortname


The other way around:

DECLARE INTEGER GetLongPathName IN kernel32;
    STRING    lpszShortPath,;
    STRING  @ lpszLongPath,;
    INTEGER   cchBuffer

cLongPath = space(1024)
?GetLongPathName( m.cShortName, @cLongPath, len( cLongPath))
?m.cLongPath

Boudewijn LutgeĀ®ink
Universal Truth is never changing. most of what we conceive as a truth is only temporarily and thus questionable.

COMPLETE THREAD

MS-Dos address Posted by Poppy Fdn @ 11/11/2009 6:45:17 AM
RE: MS-Dos address Posted by Boudewijn Lutgerink @ 11/11/2009 9:06:05 AM
RE: MS-Dos address Posted by Jun Tangunan @ 11/11/2009 9:13:41 AM
RE: MS-Dos address Posted by Boudewijn Lutgerink @ 11/11/2009 9:17:13 AM
RE: MS-Dos address Posted by Jun Tangunan @ 11/11/2009 9:09:37 AM