A
A
alexrett2016-03-09 17:14:33
C++ / C#
alexrett, 2016-03-09 17:14:33

How to get IDLE time in C under Windows?

Can anyone suggest how to properly get user activity idle time under Windows in C?
All the solutions I found are implemented in C#...
Ideally I would like something similar on MacOSX or Linux
https://github.com/gpolitis/xidle
https://github.com/kairichard/idler
Perhaps someone then tell me some cross-platform library to get idle time?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Dubrovin, 2016-03-10
@alexrett

GetLastInputInfo()

A
Alexander Ananiev, 2016-03-09
@SaNNy32

User inactivity is expressed in the fact that he does not move the mouse and does not knock on the keys?
Then you can simply put a hook on these events through SetWindowsHookEx and track inactivity by a timer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question