By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,116 Members | 1,319 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,116 IT Pros & Developers. It's quick & easy.

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

P: 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
Share this Question
Share on Google+
2 Replies

P: 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
  10.         End If
  11.     End Sub
  12. End Class
Dec 29 '14 #2

P: 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
  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.