M
Miro
I'm using VB.Net 2003
I have code - it works great - to kill a process(s) if they are running.
----
Dim myProcesses() As Process 'Funny - withouth the () in the
myProcesses it does not work
Dim myProcess As Process
myProcesses = Process.GetProcessesByName(Trim(TextBox1.Text))
For Each myProcess In myProcesses
myProcess.Kill()
Next
Close() 'Program stops running after it is run.
----
The user has a program that runs, but when the program loads, sometimes it
loads in the
"Processes" tab, but not in the Application tab ( of the Windows Task
Manager ). This program
loads up some files associated with it, and actaully Locks these files until
its killed. This program also
only allows you to run one instance of it.
So what I would like to do, is Get all the processes ( see above code ), and
see if there is an Application
running associated with it.
If there is not, then kill that process.
If there is an Application, then just set focus to it.
I cannot find help on this on the net.
Can someone point me in the right direction please.
Thanks,
Miro
I have code - it works great - to kill a process(s) if they are running.
----
Dim myProcesses() As Process 'Funny - withouth the () in the
myProcesses it does not work
Dim myProcess As Process
myProcesses = Process.GetProcessesByName(Trim(TextBox1.Text))
For Each myProcess In myProcesses
myProcess.Kill()
Next
Close() 'Program stops running after it is run.
----
The user has a program that runs, but when the program loads, sometimes it
loads in the
"Processes" tab, but not in the Application tab ( of the Windows Task
Manager ). This program
loads up some files associated with it, and actaully Locks these files until
its killed. This program also
only allows you to run one instance of it.
So what I would like to do, is Get all the processes ( see above code ), and
see if there is an Application
running associated with it.
If there is not, then kill that process.
If there is an Application, then just set focus to it.
I cannot find help on this on the net.
Can someone point me in the right direction please.
Thanks,
Miro