GetLastInputInfo function (Windows)

Switch View :
ScriptFree
GetLastInputInfo function

Applies to: desktop apps only

Retrieves the time of the last input event.

Syntax

BOOL WINAPI GetLastInputInfo(
  __out  PLASTINPUTINFO plii
);

Parameters

plii [out]

Type: PLASTINPUTINFO

A pointer to a LASTINPUTINFO structure that receives the time of the last input event.

Return value

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

This function is useful for input idle detection. However, GetLastInputInfo does not provide system-wide user input information across all running sessions. Rather, GetLastInputInfo provides session-specific user input information for only the session that invoked the function.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Reference
LASTINPUTINFO
Conceptual
Keyboard Input

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Content

F. Chapleau
Sample, and global monitoring

Computer monitoring can be done using GetLastInputInfo, by creating a service that runs under the local machine account, even remote sessions (RDP) can be monitored.

http://www.chapleau.info/wiki/Project_ActivityMonitoring