PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET How to detect system activity in my app?

Reply

How to detect system activity in my app?

 
Thread Tools Rate Thread
Old 13-01-2006, 03:09 PM   #1
Terry Olsen
Guest
 
Posts: n/a
Default How to detect system activity in my app?


I have a chat application. I want it to show the user as "away" if no
activity on the computer occurs for a certain amount of time.

I have a timer that I set for the correct interval, when it ticks, the chat
status changes to Away.

How can I detect any activity (mouse move, keypress, etc) on the computer
(not just in my app)?

Also, there's no Timer.Reset. So is the only way to reset the timer back to
zero by stopping and restarting the timer?


  Reply With Quote
Old 14-01-2006, 01:44 PM   #2
m.posseth
Guest
 
Posts: n/a
Default Re: How to detect system activity in my app?

Well in the old VB6 days i did this with a global keyboard and mouse hook


with GetAsyncKeyState and GetCursorPos API`s


so i guess you need to wrap thee two api`s in a class in VB.Net


regards

Michel Posseth [MCP]



"Terry Olsen" <tolsen64@hotmail.com> wrote in message
news:%23dazaNFGGHA.516@TK2MSFTNGP15.phx.gbl...
>I have a chat application. I want it to show the user as "away" if no
>activity on the computer occurs for a certain amount of time.
>
> I have a timer that I set for the correct interval, when it ticks, the
> chat status changes to Away.
>
> How can I detect any activity (mouse move, keypress, etc) on the computer
> (not just in my app)?
>
> Also, there's no Timer.Reset. So is the only way to reset the timer back
> to zero by stopping and restarting the timer?
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off