Board index » delphi » HOW TO GET LONG FILENAME FROM SHORT ?

HOW TO GET LONG FILENAME FROM SHORT ?

How I can get long filename if I have only short one ?
This happens when I use DRAG/DROP of a file on a icon of my program -
in that case, WINDOWS pass short name to a program in a form of a
command line parametter but I nees long name. So, how to convert short
name to a long one ?

I tried GETFULLPATH but it wont work - if I use short name in this
function, I get short name as a result ?!

Arminio.Gr...@USA.Net
http://www.geocities.com/SiliconValley/Way/9629/arminio.htm

 

Re:HOW TO GET LONG FILENAME FROM SHORT ?


You can get using the Windows API function GetLongFileName.

[]s Danilo Ehrhardt F. Bento
be...@sti.com.br

Arminio Grgic escreveu na mensagem <380b1060.721...@205.219.255.8>...

Quote
>How I can get long filename if I have only short one ?
>This happens when I use DRAG/DROP of a file on a icon of my program -
>in that case, WINDOWS pass short name to a program in a form of a
>command line parametter but I nees long name. So, how to convert short
>name to a long one ?

>I tried GETFULLPATH but it wont work - if I use short name in this
>function, I get short name as a result ?!

>Arminio.Gr...@USA.Net
>http://www.geocities.com/SiliconValley/Way/9629/arminio.htm

Re:HOW TO GET LONG FILENAME FROM SHORT ?


or use this:

function getlongfilename(filename : String) : String;
var sr : TSearchrec;
begin
     if findfirst(filename, FaANYFILE, sr) = 0  then
        result := extractfilepath(filename)+sr.Name;

     findclose(sr);
end;

Danilo Ehrhardt F. Bento <be...@sti.com.br> wrote in message
news:7ufael$fu5$1@news.sti.com.br...

Quote
> You can get using the Windows API function GetLongFileName.

> []s Danilo Ehrhardt F. Bento
> be...@sti.com.br

> Arminio Grgic escreveu na mensagem <380b1060.721...@205.219.255.8>...
> >How I can get long filename if I have only short one ?
> >This happens when I use DRAG/DROP of a file on a icon of my program -
> >in that case, WINDOWS pass short name to a program in a form of a
> >command line parametter but I nees long name. So, how to convert short
> >name to a long one ?

> >I tried GETFULLPATH but it wont work - if I use short name in this
> >function, I get short name as a result ?!

> >Arminio.Gr...@USA.Net
> >http://www.geocities.com/SiliconValley/Way/9629/arminio.htm

Other Threads