Timer

  • Thread starter Thread starter Eric D.
  • Start date Start date
E

Eric D.

Hi,

Is there a way to create a timer that would be able to
register the amount of time an application was open?

I read about the 'Timer' function that's part of the
Windows API, but it returns to 0 at midnight. This would
not be a desired result if a user was on the application
for more than 24 hours.

So.... any ideas?

TIA,
Eric
 
You could use the system's time to determine when the application was opened
and closed. Create a form that you will open at startup. Open this form as
hidden in the Open or Load event of your startup form. In the Load event of
this form, you would get the system time and store it in a field in the
table tracking this data. In the form's Unload event, you would again store
the system time. You could then use these 2 times to determine the length of
time the application was open. If you want to, you could even make periodic
checks (using the form's timer event) to see how long the application has
currently been open.
 
Back
Top