Autor Beitrag
Hänsel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 144



BeitragVerfasst: Do 15.09.11 12:49 
Ich möchte mit einem Button ein externes Programm starten(C:\ThermoData\start.exe).
Wie könnte da die Befehlszeile aussehen?
Kann da jemand helfen.

hänsel


Moderiert von user profile iconNarses: Topic aus Sonstiges (Delphi) verschoben am Do 15.09.2011 um 14:28
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Do 15.09.11 12:54 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
uses ..., ShellAPI

...

ShellExecute(handle, 'open''C:\programm.exe'nilnil, SW_SHOW);
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 15.09.11 12:59 
Das Forum hat auch eine Suche. :roll:
Hänsel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 144



BeitragVerfasst: So 18.09.11 10:23 
Danke, habe es getestet.Es geht.

Hänsel
Pr0g3r
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 44

Win XP
Turbo Pascal, Delphi 5&7, Ti-Basic
BeitragVerfasst: So 18.09.11 17:22 
DU kannst es auch über die cmd aufrufen lassen.
Bei dem SHellExecute gehen (zumindestens bei mir) einige Anwendungen nicht.

Winxec(PChar('C:\Programm.exe'),1); //bei 1 ist das Programm sichtbar, bei 0 unsichtbar.

Das finde ich persönlich viel angenehmer...
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 18.09.11 18:24 
Ausgerechnet WinExec... :roll:

Diese Funktion ist seit 16 Jahren veraltet und sollte nicht mehr verwendet werden. Die ist nur noch aus Kompatibilität zu 16-Bit Versionen von Windows (Windows 3.x) in Windows enthalten und wird daher vermutlich in einer der nächsten Versionen nicht mehr existieren.
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mo 19.09.11 10:17 
user profile iconPr0g3r hat folgendes geschrieben Zum zitierten Posting springen:

Bei dem SHellExecute gehen (zumindestens bei mir) einige Anwendungen nicht.


Dann machst du was falsch. Vermutung: Du gibst keinen absoluten Pfad zum Programm an. Bsp.: C:\Programme\Programm.exe statt Programm.exe