Detecting if a application is currently running then changing image to reflect that.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Muasi
    New Member
    • Dec 2014
    • 3

    Detecting if a application is currently running then changing image to reflect that.

    Hi there! Im making a program, (my first) to combine all my voice apps into one launcher (skype, raidcall, vent etc...) I want to add a green or red ball to tell if that program is currently running.

    I made a timer, set to every 1 second (That will check if "skype.exe" is running) Now im litterally lost, i have no clue on what code to use to check if skype is running.
    Once i have that i assume its simple and i can figure it out.(something like this next, i can worry about it later, but i wanna show im trying lol)
    Code:
    If skype = true Then PictureBoxskype.Image = Image.FromFile("C:\Green.jpg")
    ElseIf skype = false Then PictureBoxskype.Image = Image.FromFile("C:\Red.jpg")
    Hope to hear from you soon! <3
  • Muasi
    New Member
    • Dec 2014
    • 3

    #2
    This is what i have so far... No luck still
    Trying to make a "Light" turn on if the app (skype in this case) is open not having much luck... do i need to have this on a timer or somthing? I feel like its just not checking if its open.

    Code:
        Private Sub CheckIfRunning()
            p = Process.GetProcessesByName("skype")
            If p.Count > 0 Then
                ' Process is running
                SkypeStatus.Image = My.Resources.StatusOn
            Else
                ' Process is not running
                SkypeStatus.Image = My.Resources.StatusOff
    
            End If
        End Sub
    End Class

    Comment

    • Muasi
      New Member
      • Dec 2014
      • 3

      #3
      I got this to work!!!!! This is the code i used if anyone is interested.
      Code:
          'Check if skype is currently running, if so enable greenlight
          Private Sub skypeCheck_Tick(sender As Object, e As EventArgs) Handles SkypeCheck.Tick
              p = Process.GetProcessesByName("skype")
              If p.Count > 0 Then
                  ' Process is running
                  SkypeStatus.Image = My.Resources.StatusOn
              Else
                  ' Process is not running
                  SkypeStatus.Image = My.Resources.StatusOff
      
              End If
          End Sub

      Comment

      Working...