//==============================================================================
//创建一个快捷方式**************************************************************
//==============================================================================
function CreateLinkFile(const Info: LINK_FILE_INFO; const TargetFileName: string=''): boolean;
var OBJ: IUnknown;
ShellLink: IShellLink;
PersistFile: IPersistFile;
wFileName: WideString;
begin
wFileName := TargetFileName;
OBJ := CreateComObject(CLSID_SHELLLINK);
ShellLink := OBJ as IShellLink;
PersistFile := OBJ as IPersistFile;
ShellLink.SetPath(Info.FileName);
ShellLink.SetWorkingDirectory(Info.WorkDirectory);
ShellLink.SetDescription(Info.Description);
ShellLink.SetArguments(Info.Arguments);
ShellLink.SetIconLocation(Info.IconLocation, Info.IconIndex);
//ShellLink.SetIDList(Info.ItemIDList);
ShellLink.SetHotkey(Info.HotKey);
ShellLink.SetShowCmd(Info.ShowState);
ShellLink.SetRelativePath(Info.RelativePath,0);
if TargetFileName='' then wFileName:=ChangeFileExt(Info.FileName,'lnk');
Result := Succeeded(PersistFile.Save(PWChar(wFileName), false));
end;
//创建一个快捷方式**************************************************************
//==============================================================================
function CreateLinkFile(const Info: LINK_FILE_INFO; const TargetFileName: string=''): boolean;
var OBJ: IUnknown;
ShellLink: IShellLink;
PersistFile: IPersistFile;
wFileName: WideString;
begin
wFileName := TargetFileName;
OBJ := CreateComObject(CLSID_SHELLLINK);
ShellLink := OBJ as IShellLink;
PersistFile := OBJ as IPersistFile;
ShellLink.SetPath(Info.FileName);
ShellLink.SetWorkingDirectory(Info.WorkDirectory);
ShellLink.SetDescription(Info.Description);
ShellLink.SetArguments(Info.Arguments);
ShellLink.SetIconLocation(Info.IconLocation, Info.IconIndex);
//ShellLink.SetIDList(Info.ItemIDList);
ShellLink.SetHotkey(Info.HotKey);
ShellLink.SetShowCmd(Info.ShowState);
ShellLink.SetRelativePath(Info.RelativePath,0);
if TargetFileName='' then wFileName:=ChangeFileExt(Info.FileName,'lnk');
Result := Succeeded(PersistFile.Save(PWChar(wFileName), false));
end;
解决方案 »
- 如何获取另外程序中SysListView32组件的内容
- Happy new year!!!如何实现自动拨号上网?
- 寻找传说中的Delphi2005
- 普通高手可能解决不了‘’‘’‘’‘’‘’‘’‘
- 请教各位高手关于:clientdataset
- 什么函数能转换extended类型与integer类型?初学谢谢,在线等待!!!
- Chart问题,在线等待
- 远程连接的问题?????请各位兄弟们帮帮忙!!!!!!
- 大家帮我把这个文件(conn.asp)里的xianxiliu 和 07读出来
- cap_ip控件问题,在部分系统中无法截取IE发送的数据包
- 各位大虾,紧急求救,子表增加问题,在线等待,分数不够解决问题一定补分
- 通过ADO实现在SQLServer中创建超级用户???
FileName: array[0..MAX_PATH] of char; //目标文件名
WorkDirectory: array[0..MAX_PATH] of char; //工作目录
IconLocation: array[0..MAX_PATH] of char; //图标文件
IconIndex: integer; //图标索引
Arguments: array[0..MAX_PATH] of char; //运行参数
Description: array[0..255] of char; //文件描述
ItemIDList: PItemIDList; //系统IDList,未使用
RelativePath: array[0..255] of char; //相对路径
ShowState: integer; //运行时的现实状态
HotKey: word; //热键
end;