General Topics include: .NET Framework
Note: Most posts can be categorized into one of the forums below, where experts on that topic will be able to help you find a solution to your problem faster and more efficiently.

Go Back  Xtreme .NET Talk > .NET > General > List all running applications


Reply
 
Thread Tools Display Modes
  #1  
Old 02-05-2003, 02:08 PM
BusterG BusterG is offline
Newcomer
 
Join Date: Jan 2003
Location: United Kingdom
Posts: 15
BusterG is on a distinguished road
Default List all running applications



I am using VB.Net and would like to obtain a list of all the running applications on a PC.

I have looked at the Process Class but don't know if this is the right/best/simplest way of achieveing what I want.

I only need to list items with user interfaces (windows) not services.

Any ideas apreciated.

I meant to post this in the VB.Net forum Duh!

Last edited by BusterG; 02-05-2003 at 02:15 PM.
Reply With Quote
  #2  
Old 02-05-2003, 02:44 PM
olechko olechko is offline
Newcomer

Preferred language:
VB.NET
 
Join Date: Feb 2003
Location: Vancouver, B.C.
Posts: 3
olechko is on a distinguished road
Default

instance.GetProcesses() will return you an array of all the processes running on a machine.
Then, you can use MainWIndowHandle property of each process to find out if it has an interface. If it doesn't, this property will be 0.
Reply With Quote
  #3  
Old 02-06-2003, 03:15 AM
BusterG BusterG is offline
Newcomer
 
Join Date: Jan 2003
Location: United Kingdom
Posts: 15
BusterG is on a distinguished road
Default

Thanks for that. I'll give it a try when i've got a moment.
Reply With Quote
  #4  
Old 02-06-2003, 04:25 AM
BusterG BusterG is offline
Newcomer
 
Join Date: Jan 2003
Location: United Kingdom
Posts: 15
BusterG is on a distinguished road
Default

A posting that someone else sugested was as follows:

*****
Put a Listbox on a form, and add this to Form_Load:

Dim current As Process = Process.GetCurrentProcess()
Dim processes As Process() = Process.GetProcesses

Dim ThisProcess As Process
For Each ThisProcess In processes
'-- Ignore the current process
If ThisProcess.Id <> current.Id Then
'-- Only list processes that have a Main Window Title
If ThisProcess.MainWindowTitle <> "" Then
ListBox1.Items.Add(ThisProcess.ProcessName)
End If
End If
Next
*****

Olechko, as you said, GetProcesses returns an array which you can then itterate and return the running appications.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
List of applications running PROKA General 4 03-29-2004 06:16 PM
Get an applications icon dannyres Interoperation / Office Integration 2 11-19-2003 12:22 PM
Help on applications otherside Windows Forms 1 07-12-2003 10:38 AM
How to list running threads jjjamie General 1 04-21-2003 04:59 PM
obtaning running applications on my PC inti General 5 02-12-2003 08:34 AM

Advertisement:







Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe