sfile:=....\*.ttf;
filename:=extractfilepath(ParamStr(0))+*.ttf;
if not copyfile(pchar(sfile),pchar(filename),false) then
showmessage('failure!');
filename:=extractfilepath(ParamStr(0))+*.ttf;
if not copyfile(pchar(sfile),pchar(filename),false) then
showmessage('failure!');
解决方案 »
- Access怎样修改"id"使当前记录移到最后
- Fast Report 如果在DesignReport时隐藏某些菜单?
- 一个关于ado连接的问题
- 哪一个网站可以很好地查图书资料?
- 关于、《Delphi 5 开发人员指南》
- 自动配置数据库环境
- 我用createfile建的文本文件怎么就不能向里写东西?Createfile调用如下:
- delphi 中是否能定义类似于 pb 中的全局变量!如果能该怎么定义?在线等。。。。。
- 问个问题:在DELPHI中调哪个API函数或者是命令来实现显示桌面,还有如何调输入法出来
- delphi语法---packed record
- 用ADO实现联接SQL Server数据库的语句
- 请问到哪些地方可以下载免费的制作delphi的安装软件
uses ShlObj, ActiveX, ComObj;
...
procedure TForm1.Button1Click(Sender: TObject);
var
IObject : IUnknown;
ISLink : IShellLink;
IPFile : IPersistFile;
PIDL : PItemIDList;
InFolder : array[0..MAX_PATH] of Char;
TargetName : String;
LinkName : WideString;
begin
TargetName := 'c:\windows\calc.exe'; {Use TargetName:=ParamStr(0) which
returns the path and file name of the
executing program to create a link to your
Application} IObject := CreateComObject(CLSID_ShellLink);
ISLink := IObject as IShellLink;
IPFile := IObject as IPersistFile; with ISLink do begin
SetPath(pChar(TargetName));
SetWorkingDirectory
(pChar(ExtractFilePath(TargetName)));
end; // if we want to place a link on the Desktop
SHGetSpecialFolderLocation
(0, CSIDL_DESKTOPDIRECTORY, PIDL);
SHGetPathFromIDList
(PIDL, InFolder); {
or if we want a link to appear in
some other, not-so-special, folder:
InFolder := 'c:\SomeFolder'
} LinkName := InFolder + '\Delphi Created Link.lnk';
IPFile.Save(PWChar(LinkName), false);
end;
SHGetSpecialFolderLocation
(0, CSIDL_DESKTOPDIRECTORY, PIDL);
SHGetPathFromIDList
(PIDL, InFolder);是获得桌面文件夹所在的路径。