Board index » delphi » Kill a process in Delphi

Kill a process in Delphi

Hi,

I need to kill a process, I got it's id, now I need to kill it.

TIA!

--

The history of liberty is a history of
the limitations of governmental power,
not the increase of it.

 

Re:Kill a process in Delphi


if you have the threadID you can use the
EnumThreadWindows.
and find the main window that matches the thread id.
then you post a WM_CLANCELMODE and WM_CLOSE to it..
Quote
Dave wrote:
> Hi,

> I need to kill a process, I got it's id, now I need to kill it.

> TIA!

> --

> The history of liberty is a history of
> the limitations of governmental power,
> not the increase of it.

Re:Kill a process in Delphi


Thanks Maynard,

no window
it's a particular dllhost (there are many, I have the PID of the
one I want to kill, that's it).

Quote
"Maynard Philbrook" <jami...@mindspring.com> wrote in message

news:3E1218CE.FB35D4FA@mindspring.com...
Quote
> if you have the threadID you can use the
> EnumThreadWindows.
> and find the main window that matches the thread id.
> then you post a WM_CLANCELMODE and WM_CLOSE to it..

> Dave wrote:

> > Hi,

> > I need to kill a process, I got it's id, now I need to kill it.

> > TIA!

> > --

> > The history of liberty is a history of
> > the limitations of governmental power,
> > not the increase of it.

Re:Kill a process in Delphi


Quote
Dave wrote in message ...
>Hi,

>I need to kill a process, I got it's id, now I need to kill it.

First send it a WM_CLOSE or WM_QUIT, if that doesn't work
TerminateProcess. I guess.

Groetjes,
Maarten Wiltink

Re:Kill a process in Delphi


Thx Maarten,

Have a good 2003!

Quote
"Maarten Wiltink" <maar...@kittensandcats.net> wrote in message

news:3e12f71b$0$144$e4fe514c@news.xs4all.nl...
Quote
> Dave wrote in message ...
> >Hi,

> >I need to kill a process, I got it's id, now I need to kill it.

> First send it a WM_CLOSE or WM_QUIT, if that doesn't work
> TerminateProcess. I guess.

> Groetjes,
> Maarten Wiltink

Re:Kill a process in Delphi


The OpenProcess() and TerminateProcess() seem to be what would work,

now I get an "Acces denied" message!

Quote
"Dave" <dave1...@hotmail.com> wrote in message

news:mdnQ9.17916$796.351458@wagner.videotron.net...
Quote
> Hi,

> I need to kill a process, I got it's id, now I need to kill it.

> TIA!

> --

> The history of liberty is a history of
> the limitations of governmental power,
> not the increase of it.

Re:Kill a process in Delphi


Quote
Dave wrote in message

>The OpenProcess() and TerminateProcess() seem to be what would work,

>now I get an "Acces denied" message!

Obviously you're not allowed to kill that process.
What makes you think you are?

Groetjes,
Maarten Wiltink

Re:Kill a process in Delphi


Nothing, I'm just trying.

Quote
"Maarten Wiltink" <maar...@kittensandcats.net> wrote in message

news:3e136b7e$0$142$e4fe514c@news.xs4all.nl...
Quote
> Dave wrote in message

> >The OpenProcess() and TerminateProcess() seem to be what would work,

> >now I get an "Acces denied" message!

> Obviously you're not allowed to kill that process.
> What makes you think you are?

> Groetjes,
> Maarten Wiltink

Other Threads