Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing open applications at runtime
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00784022
Message ID:
00784125
Views:
13
This message has been marked as the solution to the initial question of the thread.
Hi Kevin,

You want to use the Process class located in the System.Diagnostic namespace. Here is some sample VB.NET code:
'Declare an array of processes
Dim myProcesses() as System.Diagnostic.Process

'A single process variable
Dim myProcess As System.Diagnostic.Process

'Get the list of processes
myProcesses = System.Diagnostic.Process.GetProcesses()

' Iterate through the process array.
For Each myProcess in myProcesses
   Console.WriteLine(myProcess.ProcessName)

   ' If you want to stop a process with a graphical interface then call
   myProcess.CloseMainWindow()

   ' If you want to stop a process without a graphical interface then call
   myProcess.Kill()
Next
>Hi
>
>I wish to be able to access the open applications/windows currently running on the operating system at runtime from VB.Net. What I basically need to do is check all the open apps/windows and if necessary, close some of them down.
>
>Could anyone give me an example in VB.Net?
>
>Thanks
>Kev
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform