On 24-06-2021 07:12 pm, Marco wrote:
Hi, there is a function in xharbour returning the short file name in 8.3 format of a long file name?
EXAMPLE:
LF_ToShort("long_file_name.txt") -> "LONGFI~1.TXT"
thanks.
Hi,
Please try with the following:
#pragma begindump
#include <windows.h>
#include "hbapi.h"
HB_FUNC( GETSHORTPATHNAME )
{
char buffer[ MAX_PATH + 1 ] = {0};
GetShortPathName( hb_parcx(1), buffer, MAX_PATH );
hb_retc( buffer );
}
HB_FUNC( GETSHORTFILENAME )
{
char pszReturn[ MAX_PATH ] ;
pszReturn[0]= '\0' ;
GetShortPathName( hb_parcx( 1 ), pszReturn, MAX_PATH - 1 ) ;
hb_retc( pszReturn ) ;
}
#pragma enddump
HTH,
Warm regards,
Jayadev
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)