473,508 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Handling a running Process

I want to handle a running process. ex: explorer.exe

How can i handle that process(explorer.exe). and is it possilbe to
stop that process from runing.

Jun 24 '07 #1
7 2684
// System.Diagnostics namespace
Process[] procs = Process.GetProcessesByName("EXPLORE");
if (procs[0].Responding )
MessageBox.Show("EXPLORE is Responding");
else
MessageBox.Show("EXPLORE is Not Responding");
else
MessageBox.Show("EXPLORE is Not Running");
if (procs[0].Responding)
procs[0].CloseMainWindow();
else
procs[0].Kill();
}
catch
{
MessageBox.Show("Could Not Find the EXPLORE Process");
}

-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"sravan_reddy001" wrote:
I want to handle a running process. ex: explorer.exe

How can i handle that process(explorer.exe). and is it possilbe to
stop that process from runing.

Jun 24 '07 #2
Peter Bromberg [C# MVP] wrote:
// System.Diagnostics namespace
Process[] procs = Process.GetProcessesByName("EXPLORE");
if (procs[0].Responding )
MessageBox.Show("EXPLORE is Responding");
else
MessageBox.Show("EXPLORE is Not Responding");
else
MessageBox.Show("EXPLORE is Not Running");
if (procs[0].Responding)
procs[0].CloseMainWindow();
else
procs[0].Kill();
}
catch
{
MessageBox.Show("Could Not Find the EXPLORE Process");
}

-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"sravan_reddy001" wrote:
>I want to handle a running process. ex: explorer.exe

How can i handle that process(explorer.exe). and is it possilbe to
stop that process from runing.

Hi,
Process[] procs = Process.GetProcessesByName("EXPLORE");
if (procs[0].Responding )
Just a quick observation, I think the code is missing an if clause.

--
Tom Spink
University of Edinburgh
Jun 24 '07 #3
private void Form1_Load(object sender, EventArgs e)
{
Process []p = Process.GetProcessesByName("Opera.exe");
if (p.Length != 0)
{
if (p[0].Responding)
{
label1.Text = "Explorer Responding";
//p[0].CloseMainWindow();
}
else
{
label1.Text = "Explorer Not Responding";
//p[0].Kill();
}
}
else
{
label1.Text = "Explorer not running";
}
this is code i had given in my prog

the display is always "Explorer not running" i tried giving giving
different names but no result.

Jun 24 '07 #4
On 24 Jun., 18:03, sravan_reddy001 <sravanganta2...@gmail.comwrote:
private void Form1_Load(object sender, EventArgs e)
{
Process []p = Process.GetProcessesByName("Opera.exe");
if (p.Length != 0)
{
if (p[0].Responding)
{
label1.Text = "Explorer Responding";
//p[0].CloseMainWindow();
}
else
{
label1.Text = "Explorer Not Responding";
//p[0].Kill();
}
}
else
{
label1.Text = "Explorer not running";
}

this is code i had given in my prog

the display is always "Explorer not running" i tried giving giving
different names but no result.
If memory serves, the name of the process should be "Opera", not
"Opera.exe".

hth,
Kevin Wienhold

Jun 25 '07 #5
I gav the name opera, explorer and Explorer, explorer.exe and tried
many others.

the message is Explorer Not Running in the label1

Jun 25 '07 #6
sravan_reddy001 wrote:
I gav the name opera, explorer and Explorer, explorer.exe and tried
many others.

the message is Explorer Not Running in the label1
Hi,

Did you try: "EXPLORE"?

--
Tom Spink
University of Edinburgh
Jun 25 '07 #7
i tried....

when i tried for "svchost" i got the result...
but didn't got anthing about "Explorer"

Jun 26 '07 #8

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

Similar topics

12
3657
by: Ritz, Bruno | last post by:
hi in java i found that when a method has a throws clause in the definition, callers must either handle the exceptions thrown by the method they are calling or "forward" the exception to the...
2
5102
by: xAvailx | last post by:
I have a requirement that requires detection of rows deleted/updated by other processes. My business objects call stored procedures to create, read, update, delete data in a SQL Server 2000 data...
2
3003
by: Steve Jorgensen | last post by:
When writing VB or VBA code that works with databases or other external libraries that cannot be trusted to automatically do the right thing when references to their objects are arbitrarily...
11
4816
by: suzy | last post by:
i am trying to write aspx login system and the login process requires a validity check of username and password. i have been told that raising exception is costly, but i want a custom error...
6
3170
by: m | last post by:
Hello, I have an application that processes thousands of files each day. The filenames and various related file information is retrieved, related filenames are associate and placed in a linked...
4
1912
by: Al Williams | last post by:
Hi, I have error handling in place throughout my application. I also start the application wrapped in error handling code to catch any unexpected exceptions (i.e. exceptions that occur where I...
4
2107
by: Tad Marshall | last post by:
Hi, I'm having limited luck getting an ApplicationException to work right in my code. This is VB.NET, VS 2003, Windows XP SP2, .NET Framework 1.1. I thought it would be convenient to take...
132
5456
by: Zorro | last post by:
The simplicity of stack unraveling of C++ is not without defective consequences. The following article points to C++ examples showing the defects. An engineer aware of defects can avoid...
1
332
by: sravan_reddy001 | last post by:
I want to handle a running process. ex: explorer.exe How can i handle that process(explorer.exe). and is it possilbe to stop that process from runing.
1
4797
by: 32Alpha | last post by:
Hi, first post here. First off, this IS a homework assignment for an operating systems class, but the question isn't "how do i do the assignment" but "why is my particular implementation not...
0
7336
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,...
1
7066
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5059
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
3214
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
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
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 ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.