By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,589 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,589 IT Pros & Developers. It's quick & easy.

get running apps. name

P: n/a
Hi, im writing a program to keep track of which programs is currently running. I would like to have the caption of running programs displayed in a textbox on my form. I cant seem to find an easy way to do this in vb.net. Does anybody have a piece of code that can help me?

Thanks
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
See System.Diagnostics.Processes

"sneffe" <an*******@discussions.microsoft.com> wrote in message
news:E5**********************************@microsof t.com...
Hi, im writing a program to keep track of which programs is currently running. I would like to have the caption of running programs displayed in a
textbox on my form. I cant seem to find an easy way to do this in vb.net.
Does anybody have a piece of code that can help me??
Thanks

Nov 20 '05 #2

P: n/a
See System.Diagnostics.Processes

"sneffe" <an*******@discussions.microsoft.com> wrote in message
news:E5**********************************@microsof t.com...
Hi, im writing a program to keep track of which programs is currently running. I would like to have the caption of running programs displayed in a
textbox on my form. I cant seem to find an easy way to do this in vb.net.
Does anybody have a piece of code that can help me??
Thanks

Nov 20 '05 #3

P: n/a
Whoops

my bad...

this is straight from the help system.

When working with processes on a system, it is sometimes necessary to view
all processes that are running at a given time. For example, if you want to
create an application that gives you the functionality of stopping
processes, you must first see which processes are running. You could fill a
list box with the process names and select which process to perform any
other actions on.
To view running processes
Declare an empty array of the type Process.
Fill the empty array with the return value from the GetProcesses method.
Iterate through the process array using the indexed value to obtain the
process name of each process in the array and write it to a console.
The following example shows how to call the GetProcesses method of a Process
component to return the process array and writes the ProcessName value to a
console.
' Visual Basic
Dim myProcesses() as Process
Dim myProcess As Process
myProcesses = Process.GetProcesses()
' Iterate through the process array.
For Each myProcess in myProcesses
Console.WriteLine(myProcess.ProcessName)
Next

// C#
Process[] myProcesses = Process.GetProcesses();
foreach(Process myProcess in myProcesses)
{
Console.WriteLine(myProcess.ProcessName);
}
"sneffe" <an*******@discussions.microsoft.com> wrote in message
news:92**********************************@microsof t.com...
Processes is no a member of System.Dianostics, and if i use process

instead i only get the process of my own application not other running at
the same time. I have seen an API function called "GetWindowText", but dont
know how to use it.
Nov 20 '05 #4

P: n/a
Whoops

my bad...

this is straight from the help system.

When working with processes on a system, it is sometimes necessary to view
all processes that are running at a given time. For example, if you want to
create an application that gives you the functionality of stopping
processes, you must first see which processes are running. You could fill a
list box with the process names and select which process to perform any
other actions on.
To view running processes
Declare an empty array of the type Process.
Fill the empty array with the return value from the GetProcesses method.
Iterate through the process array using the indexed value to obtain the
process name of each process in the array and write it to a console.
The following example shows how to call the GetProcesses method of a Process
component to return the process array and writes the ProcessName value to a
console.
' Visual Basic
Dim myProcesses() as Process
Dim myProcess As Process
myProcesses = Process.GetProcesses()
' Iterate through the process array.
For Each myProcess in myProcesses
Console.WriteLine(myProcess.ProcessName)
Next

// C#
Process[] myProcesses = Process.GetProcesses();
foreach(Process myProcess in myProcesses)
{
Console.WriteLine(myProcess.ProcessName);
}
"sneffe" <an*******@discussions.microsoft.com> wrote in message
news:92**********************************@microsof t.com...
Processes is no a member of System.Dianostics, and if i use process

instead i only get the process of my own application not other running at
the same time. I have seen an API function called "GetWindowText", but dont
know how to use it.
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.