getting a list of running applications

K

Kevin

how can I get a list of applications running on the system (the list
that appears in the applications tab of the task manager) and set one of
them active? I am trying to have my app find other running apps and
switch focus to one of them
thanks
kevin
 
K

Ken Tucker [MVP]

Hi,

For Each p As Process In Process.GetProcesses

Trace.WriteLine(p.ProcessName)

Next



Ken

-----------------------

how can I get a list of applications running on the system (the list
that appears in the applications tab of the task manager) and set one of
them active? I am trying to have my app find other running apps and
switch focus to one of them
thanks
kevin
 
K

Kevin

Ken said:
Hi,

For Each p As Process In Process.GetProcesses

Trace.WriteLine(p.ProcessName)

Next



Ken

-----------------------

how can I get a list of applications running on the system (the list
that appears in the applications tab of the task manager) and set one of
them active? I am trying to have my app find other running apps and
switch focus to one of them
thanks
kevin

thanks Ken,
that close, but I am looking for applications not processes
kevin
 
H

Herfried K. Wagner [MVP]

Kevin said:
how can I get a list of applications running on the system (the list that
appears in the applications tab of the task manager) and set one of them
active? I am trying to have my app find other running apps and switch
focus to one of them

'System.Diagnostics.Process.GetProcesses' + 'AppActivate'/p/invoke
'SetForegroundWindow'.
 
K

Ken Tucker [MVP]

Hi,

A process is a running application

Ken
-------------------------------
Ken said:
Hi,

For Each p As Process In Process.GetProcesses

Trace.WriteLine(p.ProcessName)

Next



Ken

-----------------------

how can I get a list of applications running on the system (the list
that appears in the applications tab of the task manager) and set one of
them active? I am trying to have my app find other running apps and
switch focus to one of them
thanks
kevin

thanks Ken,
that close, but I am looking for applications not processes
kevin
 
B

Brian Henry

do you mean you want to differentiate between a service and a program the
user ran themselves?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top