Internet 上有一些文档显示,如果用户当前处于空闲状态,Windows 会更改 NotifyIcon.BalloonTipShown 命令的行为,这是 detected by checking for keyboard and mouse events .我目前正在开发一个大部分时间都在系统托盘中的应用程序,但会不时弹出多个气球提示,如果用户当前不在系统。由于如果显示新的气球提示,当前显示的任何气球提示都会被销毁,所以如果用户不在,我想推迟显示它们。
因此,如果应用程序最小化到系统托盘,是否有任何方法可以检查用户当前是否空闲?
最佳答案
Win32 怎么样 LASTINPUTINFO功能?
using System.Runtime.InteropServices;
[DllImport("User32.dll")]
static extern bool GetLastInputInfo(ref LASTINPUTINFO plii);
struct LASTINPUTINFO
{
public uint cbSize;
public uint dwTime;
}
关于.net - 有没有办法检查用户当前是否空闲?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19185/