在聊天应用程序 vb8 中实现计时器状态(可用、忙碌、离开等)
我目前正在开发一个聊天应用程序,并试图包括:
- 各种状态,如 MSN 那样,可用、忙碌和离开。
- 如果用户一分钟内没有触摸键盘,则将用户的状态更改为离开。 或者类似这些的东西。
我还需要该程序能够在运行时播放声音。
如果有人有类似应用程序的经验,社区可以帮助我提供资源来帮助我实现此功能,也许还可以提供任何代码吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要管理非活动状态,您可以使用与 全局键盘挂钩配对的计时器(本文适用于 C#,但您可以轻松地将其转换为 VB.NET)。每次您的应用程序收到键盘消息时,计时器都会重置为不活动间隔。如果计时器超时,您可以将应用程序的状态设置为非活动状态。
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.