本文整理自网络,侵删。
//----------------------------------------------------------- function GetShortName(sLongName: string): string; //转换长文件名 var sShortName: string; nShortNameLen: integer; begin SetLength(sShortName, MAX_PATH); nShortNameLen := GetShortPathName(PChar(sLongName), PChar(sShortName), MAX_PATH - 1); if (0 = nShortNameLen) then begin // handle errors... end; SetLength(sShortName, nShortNameLen); Result := sShortName; end;
相关阅读 >>
Delphi shellexecute调用系统命令关闭计算机
Delphi xe5 for android ttabcontrol 控件
Delphi 在rxrichedit中插入图片的完美解决方法
更多相关阅读请进入《Delphi》频道 >>