Autor Beitrag
Sebi
Hält's aus hier
Beiträge: 5



BeitragVerfasst: Di 15.07.03 15:50 
ich bin ein absoluter neuling in delphi und wollte deshalb fragen, wie ich es programmiere, dass per klick auf einen button ein anderes programm gestartet wird (exe-Datei). Bitte benutzt bei der erklärung so wenig fachwörter wie möglich.
Bela Urlaub
ontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 453

WinXP Prof/Home, Win98SE (nur auf Server)
D6 Pers
BeitragVerfasst: Di 15.07.03 16:05 
Du musst in deiner Unit in die uses ShellAPI eingeben und auf den Button doppelklicken. Nun kommt wieder die Unit.

zwischen
begin
und
end;
muss ShellExecute(Application.Handle, 'open''C:\Pfad\Anwendung.exe'nilnil, SW_SHOW);

@andere Delphilianer macht mich net fertig, wenn ich nen Fehler geschrieben hab.

@Sebi. benutz das nächste mal die Suchfunktion oda gug ins FAQ :wink:

_________________
mensch, menschen können auch probleme haben...


Zuletzt bearbeitet von Bela Urlaub am Di 15.07.03 16:06, insgesamt 1-mal bearbeitet
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Di 15.07.03 16:05 
Suche in: Delphi-Forum, Delphi-Library SHELLEXECUTE viel spass damit

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Tana´Ri
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 230



BeitragVerfasst: Di 15.07.03 16:05 
du kanns dies mit der Windows API machen, diese stellt eine Funktion namens ShellExecute zur verfügung.
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
HINSTANCE ShellExecute(

    HWND hwnd,  // handle to parent window
    LPCTSTR lpOperation,  // pointer to string that specifies operation to perform
    LPCTSTR lpFile,  // pointer to filename or folder name string
    LPCTSTR lpParameters,  // pointer to string that specifies executable-file parameters 
    LPCTSTR lpDirectory,  // pointer to string that specifies default directory
    INT nShowCmd   // whether file is shown when opened
   );

Bsp.
ausblenden Delphi-Quelltext
1:
ShellExecute(0,'open',pchar('explorer.exe'),Nil,NIL,SW_SHOW);					


ps: makier den funktionsnamen und drück F1 dann muesste die hilfe bezüglich des markierten augehn.

_________________
mfg
Tana´Ri
Sebi Threadstarter
Hält's aus hier
Beiträge: 5



BeitragVerfasst: Di 15.07.03 16:22 
danke. hat alles funktioniert. Sorry, aber habe völlig vergessen in die faqs zu gucken. habe das board noch nicht richtig erkunded.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 16.07.03 14:39 
kein problem !!! aber such bitte das nächste mal erst bevor du postest !!

_________________
In the beginning was the word.
And the word was content-type: text/plain.