[RESOLVED] Detect a process and timer
what i want to do is like xfire when you open xfire and go on a game it detects the games process and counts.
i need my program to detect alefclient.exe and when its started, i need it to start a timer to count the time i've played on it, so the timer will count up on label1 and the label1 must have the format (days, hours, mins, sec).
what i need is it to detect alefclient.exe and when it is detected, start timer then view the time in the format days, hours, mins, secs on a label.
Re: Detect a process and timer
Instead of depending on a timer to keep track of the run time it might be better to do it like this,
Get PID of the exe.
Get start time/date of PID.
In a timer call an elapsed time function to return the start time/date compared to current time/date.
At least thats how I've done it for a couple of my apps.....
Re: Detect a process and timer
exactly how i want it...
can you give me an example code?
1 Attachment(s)
Re: Detect a process and timer
Quote:
Originally Posted by
Justa Lol
can you give me an example code?
See if this helps,
Re: Detect a process and timer
works but one problem....
Re: Detect a process and timer
i found out another way but now i want my label to show the time it has run...
Day - hour:min:sec is the format i want to use. and i have no start date i just have a timer to make the label count 1 up every sec.
Re: Detect a process and timer
Quote:
works but one problem....
Not sure why unless it's a hidden exe, If you are using Shell to start the Exe might want to try using the returned value for the PID. PID=SHELL(....
Quote:
i have no start date i just have a timer to make the label count 1 up every sec.
Just use the ElapsedTime module and manually set the start time,
Code:
'start/reset
StartDate = Now
Label1 = StartDate
Label2 = "00:00:00:00"
Timer1.Enabled = True' timer set to 1000ms
Re: Detect a process and timer
i got everything working... but my process is messed up.