Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   WinExec (https://www.clubdelphi.com/foros/showthread.php?t=10401)

karlita_cb 18-05-2004 20:38:51

WinExec
 
Hola, Resulta que tengo unos botones que quiero que me abran algunas aplicaciones de la máquina, y para ello tengo algo así:

WinExec (PChar('calc.exe'),SW_SHOWNORMAL);

Y me funciona de maravilla, sólo que ahora quiero abrir word y excel, algo como le de arriba no me funciona, no sé por qué. Y podría poner toda la dirección c:\.... pero como lo voy a correr de distintos equipos no todos tienen office en la misma ruta... Cómo le hago??

roman 18-05-2004 20:48:46

Prueba con

ShellExecute(Handle, 'open', 'winword.exe', '', '', SW_SHOW);

// Saludos

karlita_cb 18-05-2004 20:52:14

Gracias
 
gracias si me funcionó

roman 18-05-2004 20:52:21

He aquí la razón de porque funcionará con ShellExecute:

Cita:

Empezado por Peter Bellow
ShellExecute will be able to find the executable since Word is one
of the apps that create a registry key under
HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths. The shell
can look up the full path there.

dada en http://groups.google.com.mx/groups?h...ccfff%40noname

// Saludos


La franja horaria es GMT +2. Ahora son las 05:48:00.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi