Important alert: (current site time 7/15/2013 9:12:49 AM EDT)
 

winzip icon

Process Viewer

Email
Submitted on: 11/4/2004 4:51:32 AM
By: Syed Muhammad Fahad  
Level: Advanced
User Rating: By 18 Users
Compatibility: C#
Views: 18501
author picture
(About the author)
 
     Need to know the running programs in you machine ??? Also, the DLLs the program is depending upon ??? And to Authority to Kill a program without invoking Task Manager ??? Then this code is for you ... It will does all the above ... It also shows the location of the exe file as well as the locations of the Dlls the process is currently using .... This code is really good for C#.Net programmers who need to know how to invoke a particular WinAPI function in C#.Net. It shows you the Modules being loaded by a particular exe file.... You can even kill a particular .Dll rather than the complete process.... This is a good code ... Please, must rate it...

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 6 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

11/5/2004 11:32:30 PM

An excellent effort!!!
(If this comment was disrespectful, please report it.)

 
11/6/2004 12:03:17 AMSana Khan

Great! but why isn't a wrapper available for calling WinPIs in CSharp ??? or is there such classes available? Please, let me know
(If this comment was disrespectful, please report it.)

 
11/26/2004 5:14:05 AM

It would be even better if you add a timer to refresh every 5-10 seconds, and minimise it to system tray.

I vote excellent.

Thx
(If this comment was disrespectful, please report it.)

 
11/29/2004 2:20:55 AMSyed Muhammad Fahad

It would be even better if you add a
timer to refresh every 5-10 seconds,
and minimise it to system tray.

I
vote excellent.

Thx

Thank you very much .... But I dont think your vote will be tailored ... Any ways I got your both suggestions and will soon incorporate them in My Code ... Thanks a lot for your feed back ...
(If this comment was disrespectful, please report it.)

 
11/29/2004 2:27:23 AMAmbrin Khan

Nice work Mr.
I think the suggestions for System Tray Minimization and Auto Refresh are cool ... But I want the following improvements as well ...
1. We can set the priority of a running thread/process via you program...
2. we should know the memory usage of each process ....
2.We can create a new process either the clone of the selected one or by browsing a particular directory ...
Anyways, a good code ....
(If this comment was disrespectful, please report it.)

 
12/1/2004 12:57:06 PMswelborn

those suggestions above are nice and all, but why make this guy do it? The fun part is doing it yourself. Thats how you learn.

Excellent work Syed, this is a good starting point for what im trying to accompolish.
(If this comment was disrespectful, please report it.)

 
1/11/2005 2:22:22 AMMuhammadUmair

how can we vire remote processes?

(If this comment was disrespectful, please report it.)

 
1/13/2005 7:28:15 PM

can enumerate processes much easier and quicker:
System.Diagnostics.Process[] procs = System.Diagnostics.Process.GetProcesses();
for(int i = 0; i < procs.Length; i++)
{
System.Diagnostics.Debug.WriteLine(procs[i].MainModule.FileName + " -- " + procs[i].MainModule.FileVersionInfo.ToString());
for(int j = 0; j < procs[i].Modules.Count; j++)
{
System.Diagnostics.Debug.WriteLine("\t" + procs[i].Modules[j].ModuleName + " -- " + procs[i].Modules[j].FileName);
}
}
(If this comment was disrespectful, please report it.)

 
1/21/2006 11:34:06 PMRiaz

hey pal!! plz reply soon...have u really tested this? i mean have u run this code?? is it workin perfectly?? plz reply fast since am plannin to do this for my project...
(If this comment was disrespectful, please report it.)

 
8/30/2006 11:48:00 AMalec

excellent work and very useful.
There is a slight problem with your ProcessList class in that two win32 exceptions are thrown on compile:
Unable to open process handle. Win32Exception: The handle is invalid.
Unable to enumurate process modules. Win32Exception: The parameter is incorrect.
This seems to prevent the refresh working as expected.
Not tracked down the problem yet but hopefully will do later

(If this comment was disrespectful, please report it.)

 
8/30/2006 6:58:21 PMalec

Thought I would follow up with resolution of problem as your code is so good ......
private static bool _isWinNT = (Environment.OSVersion.Platform == PlatformID.Win32NT);
returns true for Windows XP.
However, XP needs to run Win9xSnapshot.
So a simple mod and all is working as designed
Thanks again for the code its excellent
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.