简体   繁体   English

使用C#在Windows Mobile中获取GetIdletime

[英]GetIdletime in windows mobile using c#

Hi, I need to get the idle time of the device in one of my windows mobile app. 嗨,我需要在我的Windows移动应用程序之一中获取设备的空闲时间。 I tried all the way i couldn't get it. 我一直尝试不了。 could Any one post the code for it.. 任何人都可以为其发布代码。

Thanks in advance. 提前致谢。

To get it to work, you'll need the GetIdleTime() function from coredll.dll . 要使其正常工作,您需要coredll.dll中GetIdleTime()函数。

To access it you can use a P/Invoke command which is stated here : 要访问它,您可以使用此处说明的P / Invoke命令:

[DllImport("coredll.dll")]
static extern int GetIdleTime ();

Also you should note that some devices don't support this functionality and return a MAXDWORD instead (see GetIdleTime() description in block Return Value). 您还应该注意,某些设备不支持此功能,而是返回MAXDWORD(请参见“返回值”块中的GetIdleTime()说明)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM