[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

getting idle time from clients

Posted on 2004-10-22
1
Medium Priority
?
229 Views
Last Modified: 2012-06-27
   I'm writing a program that needs to determine the idle time of a client (means no keyboard or mouse activity from user) in a lab of 20 computers. Using VB 6.0 or a script how could I do this?
0
Comment
Question by:Fubyou
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
Sicos earned 500 total points
ID: 12386089


'**************************************
'Windows API/Global Declarations for :Sy
'     stem Idle Time
'**************************************


Private Type PLASTINPUTINFO
    cbSize As Long
    dwTime As Long
    End Type


Private Declare Function GetLastInputInfo Lib "user32.dll" (plii As PLASTINPUTINFO) As Long


Private Declare Function GetTickCount Lib "kernel32" () As Long
'**************************************
' Name: System Idle Time
' Description:This will give you the sys
'     tem idle time without using timers and s
'     tuff that constantly monitor the system
'     using API's like GetAsyncKeystate or Get
'     CursorPos. This uses the GetLastInputInf
'     o API function, returning the time the l
'     ast input happend. You it together with
'     GetTickCount gets you the system idle ti
'     me
' By: Cakkie
'
'
' Inputs:None
'
' Returns:None
'
'Assumes:None
'
'Side Effects:Works only on Win2K+ (no W
'     in95/98, sorry)
'**************************************

Dim PI As PLASTINPUTINFO

PI.cbSize = Len(PI)



If GetLastInputInfo(PI) <> 0 Then
    Label1.Caption = "System idle time: " & GetTickCount - PI.dwTime
Else
    Label1.Caption = "Function call failed"
End If


Greetings,
Sicos
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
Simple Linear Regression
Introduction to Processes

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question