Results 1 to 5 of 5

Thread: Timers

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Location
    Colombia
    Posts
    9

    Question Timers

    Dear friends,


    I want to know how can I retrieve the time an application is openned i.e. how long MSWord is in use in a session.


    Thanks.
    Danny94

  2. #2
    Megatron
    Guest
    Store the time in a variable when your application starts. Then, when you want to check the time, subtract the start time from the current time.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Location
    Colombia
    Posts
    9

    Post

    Maybe I din't explain well the question. I just want to trap every time any app on my computer starts i.e. if an user starts msword or msexcell or solitaire, I want to know how to get the time it started.


    Thanks
    Danny94

  4. #4
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    If you are on Win2K or WinXP you can use the GetThreadTimes API call:

    VB Code:
    1. Private Declare Function GetThreadTimes Lib "kernel32" (ByVal hThread As Long, lpCreationTime As FILETIME, lpExitTime As FILETIME, lpKernelTime As FILETIME, lpUserTime As FILETIME) As Long

    See the ApiThread class for how this is done...

    Hope this helps,
    Duncan
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Location
    Colombia
    Posts
    9
    TKS Duncan.

    Is there same for W98?
    Danny94

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