how to check the application is already running using vb.net,if the application is running switch to that application how to do that using vb.net..?
Please help me
Thanks in advance..
Public Function IsProcessRunning(ByVal name As String) As Boolean
For Each clsProcess As Process In Process.GetProcesses()
If clsProcess.ProcessName.StartsWith(name) Then
Return True
End If
Next
Return False
End Function
Private Sub adxcmbSwitchtoDLtool_Click(ByVal sender As System.Object) Handles adxcmbSwitchtoDLtool.Click
Dim path As String = "D:\SRIVANI\DLEWISSCM\DictaSolicitor\bin\Debug\DictaSolicitor.EXE"
If IsProcessRunning(path) = True Then
Else
Process.Start(path)
End If
end sub
i wrote code like that if i click on the button my application is open and again i click on the button again my application is running..how many times i click the button those many times the application is running how to check the opened application and switch to the application............