Ver Mensaje Individual
  #5  
Antiguo 29-10-2007
nelem nelem is offline
Miembro
 
Registrado: sep 2007
Posts: 50
Reputación: 19
nelem Va por buen camino
A ver te escribo el codigo donde ruta contiene la ruta del pdf

ShellExecute(GetDesktopWindow(),nil, PChar(Ruta),
nil, nil, SW_SHOWNORMAL);
PathAplicacion := BuscaExecutable('pdf');
EjecutaAplicacion(PathAplicacion);


function EjecutaAplicacion(prmNombreArchivo :string):Boolean;
var Retorno :Integer;
begin
Retorno := ShellExecute(Application.Handle, 'open', PChar(prmNombreArchivo), nil, nil, SW_SHOWNORMAL);
Result := True;
case Retorno of
0 :begin
MessageDlg('El sistema operativo no tiene recursos sufcientes para esta operación.', mtInformation, [mbOK], 0);
Result := False;
end;
ERROR_FILE_NOT_FOUND :begin
MessageDlg('No se ha encontrado el archivo especificado.', mtInformation, [mbOK], 0);
Result := False;
end;
ERROR_PATH_NOT_FOUND :begin
MessageDlg('No se ha encontrado el archivo especificado.', mtInformation, [mbOK], 0);
Result := False;
end;
ERROR_BAD_FORMAT :begin
MessageDlg('El ejecutable no es una aplicación válida para Win32.', mtInformation, [mbOK], 0);
Result := False;
end;
SE_ERR_ACCESSDENIED :begin
MessageDlg('El sistema operativo ha denegado el acceso al archivo indicado.', mtInformation, [mbOK], 0);
Result := False;
end;
SE_ERR_ASSOCINCOMPLETE :begin
MessageDlg('La asociación del archivo es incompleta o no válida.', mtInformation, [mbOK], 0);
Result := False;
end;
SE_ERR_DDEBUSY, SE_ERR_DDEFAIL, SE_ERR_DDETIMEOUT :begin
MessageDlg('The DDE transaction failed.', mtInformation, [mbOK], 0);
Result := False;
end;
SE_ERR_DLLNOTFOUND :begin
MessageDlg('La biblioteca dinámica no ha sido encontrada.', mtInformation, [mbOK], 0);
Result := False;
end;
SE_ERR_NOASSOC :begin
MessageDlg('There is no application associated with the given filename extension.', mtInformation, [mbOK], 0);
Result := False;
end;
SE_ERR_OOM :begin
MessageDlg('There was not enough memory to complete the operation.', mtInformation, [mbOK], 0);
Result := False;
end;
SE_ERR_SHARE :begin
MessageDlg('A sharing violation occurred.', mtInformation, [mbOK], 0);
Result := False;
end;
end;
end;
Responder Con Cita