本文介绍了GetLastInputInfo,GetTickCount与GetTickCount64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我正在尝试使用GetLastInput获取当前的空闲时间,但是我对应该检查GetTastCount或GetTickCount64的GetLastInput的返回值感到困惑.返回的值与GetTickCount64匹配,但此调用不适用于pre Vista和GetLastInput中的值只是一个DWORD而不是ULONGLONG(GetTickCount64返回的内容).重新启动后(不包括48天换行问题),我便得到了值 LASTINPUTINFO信息; info.cbSize = sizeof(info); GetLastInputInfo(& info); DWORD tickCount64 = GetTickCount64(); DWORD tickCount = GetTickCount(); tickCount64 = 769428 tickCount = 469427 info.dwTime = 763983 GetTickCount似乎总是关闭300001,此值从何而来.这是一台64位的win 7机器.我在其他3台计算机上尝试过,它们在2台计算机上返回相同的值,而在另外1台计算机上返回不同的值.所有人都安装了Visual Studio可以吗 是一个因素吗?您认为这是怎么回事.谢谢scott 解决方案 I'm trying to get the current idle time using GetLastInput but i'm confused by what i should be checking the return of GetLastInput against, GetTickCount or GetTickCount64. The value returns matches GetTickCount64 but this call doesn't work on pre vista and the value from GetLastInput is only a DWORD not a ULONGLONG (what GetTickCount64 returns).Just after a restart (this excludes 48 day wrap issue) i get the valuesLASTINPUTINFO info; info.cbSize = sizeof(info);GetLastInputInfo(&info); DWORD tickCount64 = GetTickCount64();DWORD tickCount = GetTickCount();tickCount64 = 769428tickCount = 469427info.dwTime = 763983GetTickCount seems to always be 300001 off, where is this value from. This is a 64 bit win 7 machine. I've tried on 3 other machines and they return the same value on 2 and different on 1 other. All have visual studio installed could this be a factor?What do you think is going on.thanksscott 解决方案 这篇关于GetLastInputInfo,GetTickCount与GetTickCount64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-17 21:48