468,103 Members | 1,249 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,103 developers. It's quick & easy.

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

3
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)
Expand|Select|Wrap|Line Numbers
  1. If skype = true Then PictureBoxskype.Image = Image.FromFile("C:\Green.jpg")
  2. ElseIf skype = false Then PictureBoxskype.Image = Image.FromFile("C:\Red.jpg")
Hope to hear from you soon! <3
Dec 29 '14 #1
2 1051
Muasi
3
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.

Expand|Select|Wrap|Line Numbers
  1.     Private Sub CheckIfRunning()
  2.         p = Process.GetProcessesByName("skype")
  3.         If p.Count > 0 Then
  4.             ' Process is running
  5.             SkypeStatus.Image = My.Resources.StatusOn
  6.         Else
  7.             ' Process is not running
  8.             SkypeStatus.Image = My.Resources.StatusOff
  9.  
  10.         End If
  11.     End Sub
  12. End Class
Dec 29 '14 #2
Muasi
3
I got this to work!!!!! This is the code i used if anyone is interested.
Expand|Select|Wrap|Line Numbers
  1.     'Check if skype is currently running, if so enable greenlight
  2.     Private Sub skypeCheck_Tick(sender As Object, e As EventArgs) Handles SkypeCheck.Tick
  3.         p = Process.GetProcessesByName("skype")
  4.         If p.Count > 0 Then
  5.             ' Process is running
  6.             SkypeStatus.Image = My.Resources.StatusOn
  7.         Else
  8.             ' Process is not running
  9.             SkypeStatus.Image = My.Resources.StatusOff
  10.  
  11.         End If
  12.     End Sub
Dec 29 '14 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Brian | last post: by
1 post views Thread by Paul Aspinall | last post: by
reply views Thread by David Eales | last post: by
7 posts views Thread by petethebloke | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.