Long file names on windows lazarus / 8-Other ---------------------------------------------------------------------- typo · 2009-06-05 17:19 How to get long file names from short file names on windows with Lazarus? ---------------------------------------------------------------------- clauslack · 2009-06-07 00:52 I found this functions Convert Short filenames to Long filenames Code: [Select]uses shellapi; { TForm1 } //from C:\2MINUT~1.PPS    to   2minutosdesarcasmo.pps function GetLongFileName(const sFileName: string): string; var   SHFileInfo: TSHFileInfo; begin   if SHGetFileInfo(PChar(sFileName),                    0,                    SHFileInfo,                    SizeOf(SHFileInfo),                    SHGFI_DISPLAYNAME) <> 0 then     Result := string(SHFileInfo.szDisplayName)   else     Result := sFileName; end; Convert Long filenames to Short filenames Code: [Select]uses windows; //from c:\2minutosdesarcasmo.pps to C:\2MINUT~1.PPS function GetShortFilename(const FileName: TFileName): TFileName; var  buffer: array[0..MAX_PATH-1] of char; begin   SetString(Result, buffer, GetShortPathName(pchar(FileName), buffer, MAX_PATH-1)); end;   This only works in Windows. Tested in Windows XP SP3 (fat32 and NTFS) with Lazarus 0.9.27 fpc 2.2.4 Regards