Results 1 to 8 of 8

Thread: [RESOLVED] Detect a process and timer

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Resolved [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.
    Last edited by Justa Lol; Mar 17th, 2009 at 11:47 AM.

  2. #2
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    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.....
    Last edited by Edgemeal; Apr 25th, 2009 at 02:02 AM.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: Detect a process and timer

    exactly how i want it...


    can you give me an example code?
    Last edited by Justa Lol; Mar 17th, 2009 at 06:25 PM.

  4. #4
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Detect a process and timer

    Quote Originally Posted by Justa Lol View Post
    can you give me an example code?
    See if this helps,
    Attached Files Attached Files

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: Detect a process and timer

    works but one problem....
    Last edited by Justa Lol; Oct 30th, 2011 at 03:59 AM.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    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.

  7. #7
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Detect a process and timer

    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(....

    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

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: Detect a process and timer

    i got everything working... but my process is messed up.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width