1

I am currently developing a chat application and am trying to include:

  • Various states, like MSN does, available, busy and away.
  • If the user doesn't touch the keyboard for one minute, the state of the user isto be changed into Away. Or something similar to these.

I also need the program to be able to play a sound while running.

Can the community aid me with resources to help me implement this and perhaps any code if anyone has experience with a similar application?

thejartender
  • 9,339
  • 6
  • 34
  • 51
user501625
  • 27
  • 1
  • 4

1 Answers1

2

To manage an inactive state, what you can do is use a timer paired with a global keyboard hook (the article is for C#, but you can easily translate it to VB.NET). Each time your application receives a keyboard message, the timer will be reset to the inactivity interval. If the timer runs out, you can set the status of your application to be inactive.

Community
  • 1
  • 1
Adam Maras
  • 26,269
  • 6
  • 65
  • 91