Autor Beitrag
JJ
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100

Windows XP 64 bit!
delphi 5
BeitragVerfasst: Sa 03.02.07 20:42 
Hallo! Könnt ihr mir einen Codefetzen geben, mit dem ich alle Instanzen des Internet Explorers auf einmal schließen kann?

_________________
Hallo!
Regan
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2157
Erhaltene Danke: 72


Java (Eclipse), Python (Sublimetext 3)
BeitragVerfasst: Sa 03.02.07 21:59 
Versuchs doch mal mit:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
uses
TlHelp32, ShellAPi, ShlOBJ,
  ActiveX
{...}
function Killtask(const name:string):boolean;
var p:TProcessEntry32;
h:THandle;
begin
result:=false;
p.dwSize:=Sizeof(p);
h:=CreateToolHelp32snapshot(TH32CS_SnapProcess,0);

 if Process32First(h,p) then
  repeat
    if AnsiLowerCase(Extractfilename(p.szExeFile))=AnsiLowerCase(name) then
    Result:=TerminateProcess(Openprocess(PROCESS_TERMINATE,BOOL(0),p.th32ProcessID),0);
  until (not Process32Next(h,p)) or Result;
 CloseHandle(h);
end;
{...}
var
a:Boolean;
begin
while a=true do
begin
a:=Killtask('iexplore.exe');
end;
end;
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 04.02.07 14:12 
Hallo!

Ich musste hier erstaunlich viele Beiträge löschen. Bitte tragt Streitereien demnächst per PN aus. Danke!

Grüße
Christian

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
JJ Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100

Windows XP 64 bit!
delphi 5
BeitragVerfasst: Mo 05.02.07 22:07 
was denn für streitereien:) .... danke für den code aber der funktioniert leider nich ... hast du vielleicht irgendwo noch was vergessen?

_________________
Hallo!
JJ Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100

Windows XP 64 bit!
delphi 5
BeitragVerfasst: Mo 05.02.07 22:13 
ich nehm alles zurück ... geht super :) danke

_________________
Hallo!