Home All Groups Group Topic Archive Search About

Running Applications

Author
8 Feb 2007 7:04 PM
Roman Benko
Is there a way using .Net to determine which applications are currently
running?  For example, in Windows, if you press Alt-Tab, you will see a list
of applications currently running.  I have looked at process.getprocesses,
but that returns all running processes instead of just applications.  I would
like to fill a listbox with a list of applications (not processes) that are
currently running.  Thanks.

Author
8 Feb 2007 7:51 PM
Mattias Sjögren
>Is there a way using .Net to determine which applications are currently
>running?  For example, in Windows, if you press Alt-Tab, you will see a list
>of applications currently running.  I have looked at process.getprocesses,
>but that returns all running processes instead of just applications.  I would
>like to fill a listbox with a list of applications (not processes) that are
>currently running.  Thanks.

I'm not sure what yoru definition of "application" is, but I believe
the Alt-Tab window is populated with top-level windows returned by the
EnumWindows Win32 API.


Mattias

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Author
8 Feb 2007 9:57 PM
Roman Benko
Thank you for pointing me in the right direction.  I have been searching the
Internet for sample code that uses VB .Net 2005 and the EnumWindows Win32
API.  If anyone has any code that shows this, I would appreciate it.  Thanks.


Show quote
"Mattias Sjögren" wrote:

> >Is there a way using .Net to determine which applications are currently
> >running?  For example, in Windows, if you press Alt-Tab, you will see a list
> >of applications currently running.  I have looked at process.getprocesses,
> >but that returns all running processes instead of just applications.  I would
> >like to fill a listbox with a list of applications (not processes) that are
> >currently running.  Thanks.
>
> I'm not sure what yoru definition of "application" is, but I believe
> the Alt-Tab window is populated with top-level windows returned by the
> EnumWindows Win32 API.
>
>
> Mattias
>
> --
> Mattias Sjögren [C# MVP]  mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.
>
Author
9 Feb 2007 6:11 AM
Mattias Sjögren
>Thank you for pointing me in the right direction.  I have been searching the
>Internet for sample code that uses VB .Net 2005 and the EnumWindows Win32
>API.  If anyone has any code that shows this, I would appreciate it.  Thanks.


http://msdn2.microsoft.com/en-us/library/843s5s5x.aspx

Unfortunately the signature it has for EnumWindows is incorrect. The
second parameter should be an IntPtr.


Mattias

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

AddThis Social Bookmark Button