View Single Post
Old June 10th, 2009   #34 (permalink)
@ruantec
Emu author
 
@ruantec's Avatar
 
Join Date: Nov 2002
Location: Austria (originally from Dominican Republic)
Posts: 2,381
Glad i could be of help

btw my nick is @ruantec and not Ruantec .... now about your questions..

Process[] procs=Process.GetProcesses(".") ensures to get all processes on every machine on your network as far as i know(i may be wrong maybe) while Environment.MachineName.ToString() just search a target machine... anyways if you move your mouse over the .MachineName you will realize that is already a string and therefore the conversion to .Tostring() is not needed so you can write Environment.MachineName.

by writing process.MainWindowTitle.Length>0 i check for the mainmodule title.. background, system and other processes doesnīt have a window at all and therefore they lack of windowtitle. opened processes do have a windowtitle and thatīs why i check there length to see if is a open process. anyways theres another method to find opened applications other than the one iīve showed you sofar but i think the one you use makes the job for now so no need to show the API way .

one last thing...when you list your process i recommend you to use a listview and create different columns for your data were in one of them you store the processID or the handle of the process.. in that way you donīt have to loop over and over to end a single process because when you click a selected item on the list you can easily get the ID back from the subitem column of your listview.. this will increase performance and at the same time make your app more responsible in case it stuck somewhere lol.

Regards
@ruantec
__________________

Current development tools:

Visual C++.net, Visual C#.net
Visual VB.net, Visual Webdeveloper.net
Bloodshed Dev C++, Borland C++
Visual Basic 6

Last edited by @ruantec; June 10th, 2009 at 08:50..
@ruantec is offline   Reply With Quote