How to detect system activity in my app?

T

Terry Olsen

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?
 
M

m.posseth

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top