Get a list of running applications/windows

  • Thread starter Thread starter Chris Bardon
  • Start date Start date
C

Chris Bardon

I'm trying to write a .net application that works with running
windows, and I can't seem to find a way to get a list of all running
applications. At one point, I wrote a quick MFC application that used
the FindWindow() command to get a handle to a window, and then set it
to be the topmost window in the system. The only problem was that you
had to specify the string of the window that you wanted to be the
topmost. I'd like to revisit this idea in .net, as well as add some
other controls (the ability to hide windows and minimize to the system
tray as well). Is there any way to get a list of all the running top
level windows in C# so that this type of control can be performed?
 
Chris Bardon said:
I'm trying to write a .net application that works with running
windows, and I can't seem to find a way to get a list of all running
applications. At one point, I wrote a quick MFC application that used
the FindWindow() command to get a handle to a window, and then set it
to be the topmost window in the system. The only problem was that you
had to specify the string of the window that you wanted to be the
topmost. I'd like to revisit this idea in .net, as well as add some
other controls (the ability to hide windows and minimize to the system
tray as well). Is there any way to get a list of all the running top
level windows in C# so that this type of control can be performed?


Check this out:
http://www.syncfusion.com/FAQ/WinForms/FAQ_c40c.asp#q687q
 
(e-mail address removed) (Chris Bardon) wrote in
I'm trying to write a .net application that works with running
windows, and I can't seem to find a way to get a list of all
running applications.

Take a look at System.Diagnostics.Process.GetProcesses(), which
returns an array of Process objects, one for each process running on
your system.

Each Process object has a MainWindowHandle property; exactly what you
can do with that, I don't know :-)
 
Back
Top