Página 1 de 1

ShellExecuteWait [Delphi]

Publicado: 29 Ene 2017, 21:41
por crack81
Funcion ShellExecuteWait es una implementacion de la version expuesta en el lenguaje Autoit [Enlace externo eliminado para invitados]
uses
  SysUtils,windows,shellApi;



function ShellExecuteWait(hWnd:HWND;Operation,Filename,Parameters,Directory:PAnsiChar;ShowCmd:Integer):Cardinal;
var
  ExecuteInfo:TShellExecuteInfoA;
  IsShellOk:LongBool;
begin
  ExecuteInfo.cbSize:=sizeof(TShellExecuteInfoA);
  ExecuteInfo.fMask:=SEE_MASK_NOCLOSEPROCESS;
  ExecuteInfo.Wnd:=hWnd;
  ExecuteInfo.lpVerb:=Operation;
  ExecuteInfo.lpFile:=Filename;
  ExecuteInfo.lpParameters:=Parameters;
  ExecuteInfo.nShow:=ShowCmd;

  IsShellOk:=ShellExecuteEx(@ExecuteInfo);
  if not IsShellOk then
  begin
    Result:=GetLastError;
    Exit;
  end
  else Result:=ExecuteInfo.hInstApp;

  if ExecuteInfo.hProcess<>0 then
    Result:=WaitForSingleObject(ExecuteInfo.hProcess,INFINITE);
end;

begin
  ShellExecuteWait(0,'open','calc.exe',nil,nil,SW_SHOWNORMAL);
  ShellExecuteWait(0,'open','notepad.exe',nil,nil,SW_SHOWNORMAL);
end.

Re: ShellExecuteWait [Delphi]

Publicado: 22 May 2017, 07:09
por joselin
use esta funcion para construir parte del bypass uac , el primero que salio
alla por el 2013
tenia que ejecutar sysprep exe esperar a que termine y limpieza
aca encontre el link
https://www.indetectables.net/viewtopic ... c562981523
saludos crack