-
January 6th, 2011, 05:53 PM
#1
Detect whether a program is open, if it is - start a timer...
Objective : Time how long a user has been on the internet.
I have never delved this deep into Visual Studio. I am suing Visual Basic 2010 Express. Please move it if you need to.
I want to have a program - that will detect running processes. If Internet Explorere EXE or Chrome or FireFox exe or any other browser is installed - as soon as that process starts the timer will appear.
When those processes are closed by the user the timer stops counting. This is possible but i dont know how. But i only want it to time just one internet process because timing them all when they are openend up at different times could cause bugs. Unless on the time form you have 1 timer for IE, 1 for FFox, 1 for Chrome 1 for Opera.... etc
Please can someone help me.
Thanks
-
January 6th, 2011, 06:15 PM
#2
Re: Detect whether a program is open, if it is - start a timer...
That's harder, as you wouldn't know about any future browsers. Maybe check the Internet Connectivity? Mine shows 4 days...
-
January 9th, 2011, 12:31 PM
#3
Re: Detect whether a program is open, if it is - start a timer...
Yeah it is hard but i've done like 80 %
I can detect a program if its open start a timer and repeat this for other browsers like chrome, IE, FireFox & Safari will add more.
If the processes are not open then the timer wont start it works.
Only thing left to do is detect if the process starts/stops at a later time to then effect a timer.
I am determined to do it
-
January 10th, 2011, 06:38 PM
#4
Re: Detect whether a program is open, if it is - start a timer...
Well, this code shows all processes... you have only to search for your browser and then activate or deactivate the timer
Code:
Dim psList() As Process
psList = Process.GetProcesses()
For Each p As Process In psList
ListBox1.Items.Add(p.Id.ToString() + " " + p.ProcessName)
Next
-
January 16th, 2011, 02:53 PM
#5
Re: Detect whether a program is open, if it is - start a timer...
well to start I think you have your own PC try opening it using your own own project application
by using shell as well as your timer
Code:
Shell("C:\Program Files\Opera\opera.exe")
Timer1.start
something like that.
-
January 16th, 2011, 02:59 PM
#6
Re: Detect whether a program is open, if it is - start a timer...
Originally Posted by cyberzen
well to start I think you have your own PC try opening it using your own own project application
by using shell as well as your timer
Code:
Shell("C:\Program Files\Opera\opera.exe")
Timer1.start
something like that.
Or
Make an invisible form1 then
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Shell("C:\Program Files\Opera\opera.exe")
Form2.show()
Me.Hide()
End Sub
End Class
Put your timer codes on form2
and make a link for this application then replace it with the Icon and shortcut of the webbrowser on your desktop
^_^
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|