Home > Net >  C # GetLastInputInfo () doesn't work in the back-end services
C # GetLastInputInfo () doesn't work in the back-end services

Time:09-21

Service not available to the system idle time, cause the program to not bottom go to, ask the great spirit guide

CodePudding user response:

Background services, running in the Session 0,
User's desktop and user program, running in the Session 1, 2, 3, and so on,

According to the GetLastInputInfo reference (https://docs.microsoft.com/zh-cn/windows/win32/api/winuser/nf-winuser-getlastinputinfo),
GetLastInputInfo cannot span Session,

The
docs.microsoft.com
...
Rather, the GetLastInputInfo provides the session - specific user input information for only the session that invoked the function.
.
To GetLastInputInfo, though only to call this function session session specific user input information,
  •  Tags:  
  • C#
  • Related