Ver Mensaje Individual
  #1  
Antiguo 27-07-2016
JuanOrtega JuanOrtega is offline
Miembro
NULL
 
Registrado: sep 2011
Posts: 130
Reputación: 13
JuanOrtega Va por buen camino
Cargar archivos con ShellExecuteEx

Hola , anteriormente me ayudaron en este foro con el siguiente codigo de efcisa :

Código Delphi [-]
...
implementation

uses ShellApi;

procedure OpenJPG(const aName: TFileName);
var
  ExecInfo: SHELLEXECUTEINFO;
begin
  ZeroMemory(@ExecInfo, SizeOf(SHELLEXECUTEINFO));
  ExecInfo.cbSize := SizeOf(SHELLEXECUTEINFO);
  ExecInfo.fMask  := SEE_MASK_NOCLOSEPROCESS;
  ExecInfo.Wnd    := 0;
  ExecInfo.lpVerb := 'open';
  ExecInfo.lpFile := PChar(aName);
 // pExecInfo.lpParameters := ...
  ExecInfo.nShow  := SW_SHOWNORMAL;
  if not ShellExecuteEx(@ExecInfo) then
    if GetLastError <= 32 then
      SysErrorMessage(GetLastError)
end;

// Uso:
procedure TForm1.Button1Click(Sender: TObject);
begin
  OpenJPG('C:\test.exe');
end;

El problema es que cuando el archivo a cargar esta oculto esta funcion tilda todo el programa ya sea grafico o consola.
Es raro porque cuando usaba Seven 32 bits no tenia este problema (ahora uso Seven 64 bits).
Cuando el archivo a cargar no esta oculto no produce ningun problema.

¿ Cual es el problema ?
Responder Con Cita