Код:
procedure RunAsAdministrator(const source:string);
var
shExecInfo: PShellExecuteInfoA;
begin
New(shExecInfo);
shExecInfo^.cbSize := SizeOf(SHELLEXECUTEINFOA);
shExecInfo^.fMask := 0;
shExecInfo^.Wnd := 0;
shExecInfo^.lpVerb := 'runas';
shExecInfo^.lpFile := PAnsiChar(ExtractFileName(source));
shExecInfo^.lpParameters := '';
shExecInfo^.lpDirectory := PAnsiChar(ExtractFilePath(source));
shExecInfo^.nShow := SW_SHOWNORMAL;
shExecInfo^.hInstApp := 0;
ShellExecuteEx(shExecInfo);
Dispose(shExecInfo);
end;
__________________
Пишу программы за еду.
__________________
|