Ver Mensaje Individual
  #11  
Antiguo 17-02-2019
mblascog mblascog is offline
Miembro
 
Registrado: may 2006
Posts: 131
Reputación: 18
mblascog Va por buen camino
Buenas, existe alguna diferencia entre ejecutar un programa o un acceso directo?

Este código abre eDrawings:
Código Delphi [-]
procedure TForm1.FormActivate(Sender: TObject);
  var ruta: string;
begin
  edit1.text := '';
  edit1.PasteFromClipboard;
  ruta := 'C:\Program Files\Common Files\eDrawings2019\eDrawings.exe';

  if fileexists(edit1.text) then
    ShellExecute(Handle, 'open', PAnsichar(ruta), PAnsichar(edit1.text), nil, SW_SHOW)
  else
    Showmessage('No existe fichero');
  Application.Terminate;
end;

He creado un acceso directo en la c:\ que abre eDrawings, lo he probado. Y cuando lo intento ejecutar en Delphi no:

procedure TForm1.FormActivate(Sender: TObject);
var ruta: string;
begin
edit1.text := '';
edit1.PasteFromClipboard;
ruta := 'C:\eDrawings.lnk';

if fileexists(edit1.text) then
ShellExecute(Handle, 'open', PAnsichar(ruta), PAnsichar(edit1.text), nil, SW_SHOW)
else
Showmessage('No existe fichero');
Application.Terminate;
end;

Alguien sabe por qué??
Muchas gracias
Responder Con Cita