Autor Beitrag
winx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249



BeitragVerfasst: Do 23.03.06 10:52 
Hallo,

wie finde ich mit Delphi.Net heraus, ob ein Programm (mit dem ich kommunizieren will) schon läuft.
Falls dieses schon läuft, soll das Programm beendet werden.

Danke,
winx


Moderiert von user profile iconChristian S.: Topic aus .NET verschoben am Mo 27.03.2006 um 21:25
Moderiert von user profile iconChristian S.: Info-Feld gesetzt
reflex
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20

Win98,WinME,WinXP, Suse Linux 10.1
D7 Pers, D3 Prof
BeitragVerfasst: Mo 27.03.06 21:12 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var W: HWnd;
begin
  W := FindWindow(NIL,'Form1');
  if W<>0 then PostMessage(W, wm_close, 11);
end


musst nur halt wissen wie der fenstername von der anwendung is die du schließen möchtest!

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt
winx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249



BeitragVerfasst: Mo 24.04.06 10:25 
das geht doch nur für Win32 Applikationen...und wie geht das unter .Net???

Danke,
winx
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mo 24.04.06 11:38 
Hallo!

Schau Dir mal im Namespace "System.Diagnostics" die Process-Klasse an. Mit der kann man auch auf bestehende Prozesse zugreifen (z.B. mit GetProcessesByName).

Grüße
Christian

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".