Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27360

VS 2010 [RESOLVED] Check Running Processes

$
0
0
This code won't work for me:

Code:

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        IsProcessRunning("notepad")
    End Sub

 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
                MsgBox("OK!")
            End If
        Next
        Return False
        MsgBox("SS")
    End Function

Actually, neither MsgBox's appear, although notepad is open.

Yes, the timer Is enabled with an interval of 1000ms

Viewing all articles
Browse latest Browse all 27360

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>