本文整理自网络,侵删。
//----------------------------------------------------------- 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 toscilloscope 仿windows任务管理器cpu使用记录组件
Delphi makeuniquefilename 创建文件名如果已经存在自动更改文件名
更多相关阅读请进入《Delphi》频道 >>