473,320 Members | 1,612 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1201
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

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

Similar topics

2
by: Brian | last post by:
On a Slackware 9.1 box, I'm trying to detect if mpg123 is currently running/playing a song so that when the song is done, it'll play the next in the list. The problem is that popen'ing ps doesn't...
2
by: abarberis | last post by:
I am writing an asp.net application which is using image buttons for the interface. I have some buttons that have a enabled and disabled state. I have written javascript code to change the image on...
0
by: Panic Student | last post by:
hi all, i'm having trouble with changing image when mouseover on a particular label. Below is what i attempted to but it didn't seem to work at all. I guess my concept is wrong ): Please...
1
by: Vagabond Software | last post by:
I'm writing an application where then end-user will want to view and print (not edit) TIFF and JPEG images. For now, I simply use the System.Diagnostics.Process.Start method to open the desired...
1
by: Paul Aspinall | last post by:
Hi I am trying to write a piece of code, which will tell me which application currently has focus / which the user is currently working on. ie. if the user is currently in IE, or Word etc.... ...
0
by: David Eales | last post by:
Hi All, I am having some difficulty when some application hang detection code, I have read the detecting hangs document on msdn but this only works for 1 monitored running app, what I would like...
7
by: petethebloke | last post by:
Can anyone help? I have a client who has made a "dynamic interactive map" of our city using Dreamweaver. Each map file has hotspots that pop-up a div with a little image when the mouse goes over...
9
by: kombu67 | last post by:
I'm reading a series of images from a MS SQL table and saving them to directory. These are staff ID pictures from our security card app. Once I've extracted the ID photo from the security app to...
2
by: almurph | last post by:
Hi, Hope you can help me wit this one. I have to open either a ".jpg", ".bmp" or a "gif" and alter its dimensions and save the output as a .gif. Here is my attempt - I would greatly...
7
by: Trastabuga | last post by:
I have a simple task: I need to change image src on the fly and then get its new width and height; var url = "/some/request"; var img = document.getElementById('my_img'); var old_width =...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.