[View Borland Home Page][View Product List][Search This Web Site][View Available Downloads][Join Borland Online][Enter Discussion Area][Send Email To Webmaster]
Delphi Devsupport

Frequently Asked Questions

Converting from Long to Short file names and paths

Question:

How do I retrieve the short file name of a given file or path?

Answer:

Use the Windows API function GetShortPathName.



Here is an Example:



procedure TForm1.Button1Click(Sender: TObject);

var

  Buffer : array [0..255] of char;

begin

  GetShortPathName(

    'C:\Program Files\Borland\Common Files\Bde\Bde32.hlp',

    @Buffer,

    sizeof(Buffer));

  Memo1.Lines.Add(Buffer);

end;

Back To Faq Index
Borland Online
Trademarks & Copyright © 1997 Borland International, Inc.