快捷方式的函数

类别:VC语言 点击:0 评论:0 推荐:

                                      快捷方式的函数

                                                [email protected]

use  shlobj,comobj,activex;//查DEL6VCL.HLP可以查到olecheck属于comobj
procedure   link(const appname,savepath:string);
var
sl:IShellLink;
pf:IPersistFile;
lnkname:widestring;
begin
olecheck(cocreateinstance(CLSID_ShellLink,nil,CLSCTX_INPROC_SERVER,IShellLink,sl));
pf:=sl as IPersistFile;
olecheck(sl.setpath(pchar(appname)));
lnkname:=savepath+'\'+changefileext(extractfilename(appname),'.lnk');
pf.save(pwidechar(lnkname),true);
end;

本文地址:http://com.8s8s.com/it/it1679.htm