forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Windows Idle time

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Wed Apr 27, 2016 8:49 pm    Post subject: Windows Idle time Reply with quote

I need to know how long a system has been idle. Is there an API call for that?

Found this, can someone convert to VDS6?

Code:

Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Declare Function GetLastInputInfo Lib "user32" (plii As Any) As Long
 
Private Type LastInputInformation
 
    cbSize As Long
 
    dwTime As Long
 
End Type
 
Public Function GetUsersIdleTime() As Long
 
    Dim lii As LastInputInformation
 
    lii.cbSize = Len(lii)
 
    Call GetLastInputInfo(lii)
 
    GetUsersIdleTime = FormatNumber((GetTickCount() - lii.dwTime) / 1000, 2)
 
End Function

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Mon May 02, 2016 8:41 pm    Post subject: Reply with quote

I just wrote my own.
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group