Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing open applications at runtime
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00784022
Message ID:
00784125
Vues:
14
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform