我正在使用以下代码在 Delphi 中创建快捷方式。我想在快捷方式的权限级别属性中选中“以管理员身份运行此程序”框来创建快捷方式。有没有办法做到这一点?
function MakeShortcut(Dst, Src: String; Desc: String = ''; Arg: String = ''; WorkDir: String = ''; Icon: String = ''; IconI: Integer = 0; Show: Integer = SW_SHOWNORMAL; HotKey: Word = 0): Boolean;
var
u: IUnknown;
s: IShellLink;
f: IPersistFile;
p: WideString;
begin
try
u := CreateComObject(CLSID_SHELLLINK);
s := u as IShellLink;
f := u as IPersistFile;
s.SetPath(PChar(Src));
if (WorkDir = '') then WorkDir := ExtractFileDir(Src);
s.SetWorkingDirectory(PChar(WorkDir));
if (Icon = '') then Icon := Src;
s.SetIconLocation(PChar(Icon), IconI);
s.SetDescription(PChar(Desc));
s.SetArguments(PChar(Arg));
s.SetShowCmd(Show);
s.SetHotkey(HotKey);
p := Dst;
Result := Succeeded(f.Save(PWChar(p), False));
except
Result := False;
end;
end;