Advertisement

11.18.2004 at 03:32AM PST, ID: 21211440
[x]
Attachment Details

Kill process

Asked by EKIM in Delphi Programming

Tags: , ,

Main question : how to kill a process (Delphi 5 or 7(as U want)  , XP )
Origin :
   I use Firebird Classic  as DB. For each connection, a new firebird process is created on the server. this would not be a problem, except when the Client lose the connection for any resaon (hard reboot, network problem...) : In such case, the process stay launched on the server, and its attached ressources stay reserved (ie Memory).

I am abble to retreive with instance is no more connected with a client, and get this PID.

I tried this, but it does not works:


procedure TForm1.KillProcess(PID: Cardinal);
var
  exitcode:UINT;
  x:THandle;
begin
  x:=Openprocess(PROCESS_ALL_ACCESS,false,PID);
  GetExitCodeProcess(x,ExitCode);
  TerminateProcess(x,Exitcode);
end;

 --> X always receive 0 from OpenProcess (why?)

I also tried this :

procedure TForm1.KillProcess(PID: Cardinal);
begin
  SendMessage(PID,wm_close,0,0);
end;

but it also does not seems to works...

Thanks for any help.

Ekim
Start Free Trial
[+][-]11.18.2004 at 03:53AM PST, ID: 12613545

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.18.2004 at 04:19AM PST, ID: 12613687

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.18.2004 at 04:37AM PST, ID: 12613774

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.18.2004 at 04:41AM PST, ID: 12613807

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.18.2004 at 04:47AM PST, ID: 12613835

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Delphi Programming
Tags: delphi, kill, process
Sign Up Now!
Solution Provided By: geobul
Participating Experts: 5
Solution Grade: A
 
 
[+][-]11.18.2004 at 04:53AM PST, ID: 12613872

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.18.2004 at 05:30AM PST, ID: 12614133

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.18.2004 at 05:47AM PST, ID: 12614286

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.18.2004 at 06:16AM PST, ID: 12614589

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.18.2004 at 06:59PM PST, ID: 12621589

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.18.2004 at 07:57PM PST, ID: 12621796

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.19.2004 at 12:51AM PST, ID: 12622960

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.19.2004 at 01:24AM PST, ID: 12623104

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.19.2004 at 01:28AM PST, ID: 12623125

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.19.2004 at 01:55AM PST, ID: 12623258

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32