快捷方式的函数

                                      快捷方式的函数

                                                [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;

你可能感兴趣的:(快捷方式的函数)