>Though I didn't play too much with API, I think you should
>
lnResult = GetShortPathName(@lcFile, @lcBuffer, @lnSize)
>?Left(lcBuffer, lnSize)
>* or
>?Left(lcBuffer,at(chr(0), lcBuffer)-1)
>
>Try this before the real API gurus wake up :)
No luck on this either. I just can't seem to make it work. Here is a more simple approach to the application that didn't work either.
DECLARE INTEGER GetShortPathName IN Win32API STRING, STRING, INTEGER
lcLongFile = "c:\program files\somefolder\my file name.doc"
lcBuffer = SPACE(511)
lnBufferSize = 511
lnShortPathLen = GetShortPathName(lcLongFile, @lcBuffer, lnBufferSize)
lcShortPath = LEFT(lcBuffer, lnBufferSize)
MessageBox(lcShortPath,16,[Test])
return