473,472 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to kill in process in task manager?

I have an application that need to launch acrobat reader. But before I
open acrobat reader, I want to check there is any existing acrobat
reader opening and kill them first.

What can I do? Can anyone kindly sugguest some idea?
Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #1
4 22905
using System.Diagnostics;

public class A
{
....
private void checkacrobat()
{
Process[] prs = Process.GetProcesses();
foreach(Process pr in prs)
{
if(pr.ProcessName == "****ProcessName")
pr.Kill();
}
}

I think this will close the process
"Thomas Chan" <yw****@hkem.com> wrote in message
news:#b*************@tk2msftngp13.phx.gbl...
I have an application that need to launch acrobat reader. But before I
open acrobat reader, I want to check there is any existing acrobat
reader opening and kill them first.

What can I do? Can anyone kindly sugguest some idea?
Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 15 '05 #2
Hi Thomas,
You can use the System.Diagnostic.Process Class to find
the what are all the applications running and can kill
that application.

Regards,
Amal
-----Original Message-----
I have an application that need to launch acrobat reader. But before Iopen acrobat reader, I want to check there is any existing acrobatreader opening and kill them first.

What can I do? Can anyone kindly sugguest some idea?
Thanks
*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
.

Nov 15 '05 #3
Thomas,

Consider the following implication - the user might have started Acrobat
Reader to open a document that has nothing to do with your application. With
your approach, you will silently terminate such an Acrobat Reader instance.
This will most likely be unexpected and unpleasant surprise to the user.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Thomas Chan" <yw****@hkem.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
I have an application that need to launch acrobat reader. But before I
open acrobat reader, I want to check there is any existing acrobat
reader opening and kill them first.

What can I do? Can anyone kindly sugguest some idea?
Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 15 '05 #4
Thanks for your advice.
Actually, what i want to do is to print a pdf file....
I have found a command from the acrobat forum and run it through the process
class. However, it does not terminate the acrobat reader after printing the
pdf file....

By the way, do you have any other ideas to print a pdf file using C#?
I really need help....thanks
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com>
???????:eB**************@TK2MSFTNGP11.phx.gbl...
Thomas,

Consider the following implication - the user might have started Acrobat
Reader to open a document that has nothing to do with your application. With your approach, you will silently terminate such an Acrobat Reader instance. This will most likely be unexpected and unpleasant surprise to the user.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Thomas Chan" <yw****@hkem.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
I have an application that need to launch acrobat reader. But before I
open acrobat reader, I want to check there is any existing acrobat
reader opening and kill them first.

What can I do? Can anyone kindly sugguest some idea?
Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Pola | last post by:
Please Help I am using VC++ in win 2000 In my appl (Win32 project) I want to control the close operation of the apl (for example if somebody will try to close appl from the "Windows Task Manager")...
6
by: Marcus | last post by:
Hi, I am a newbie at C#. Here is my current problem: I want my application to iterate through the list of tasks presented in task manager. I want it to look at the task names and if a certain...
4
by: Strah | last post by:
Is there a way to catch the event of terminating the application from the the processes tab in task manager? I have created windows app, and if a user termintates the app in the task manager,...
1
by: LBT | last post by:
Hi experts, Sometimes there is some "unkilled" processes remained in Task Manager. For instance, there is a task to generate picture using ASP image scheduled by SQL job but somehow certain...
4
by: ray well | last post by:
on my developing system, when my app exits, it always gets removed withing a second from the task manager. on my clients machine, the app exits but stays indefinitely in the task manager. i...
4
by: e-Ricc | last post by:
Hi guys! Im trying to detect when a user "kills" my c# app using windows task manager, i've tried with the form events _closing and _closed managing for example putting an if inside to detect...
3
by: muddasirmunir | last post by:
i am using vb6, the problem is that i made a accounting project with datareports,connection, and many recorset. now what happening that when i close my project it still shows in task manager that...
4
by: AliRezaGoogle | last post by:
Dear Members I have a critical program written in c#. It runs every time the user log on. But sometimes log-oned user forces my application process to quit by “End Process” in task manager. How...
2
by: news.microsoft.com | last post by:
How can a VB program detect a kill process which was used to close it down. I have a routine that detects when a user exits the program and I can track the session times. But how can I detect when...
2
by: mmda | last post by:
i have a windows service when it is start the task manager show the procees how can i hide it in task manager and nobody can kill it ?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.