Check if no user is currently logged on to Windows

前端 未结 5 828
野的像风
野的像风 2020-12-24 08:42

I\'m writing a Windows Service application which listens for connections and performs certain tasks as instructed from a different application running on another computer on

5条回答
  •  抹茶落季
    2020-12-24 09:04

    Use WTSGetActiveConsoleSessionId() to determine whether anybody is logged on locally. Use WTSEnumerateSessions() to determine if there is any session at all (including remote terminal services sessions).

提交回复
热议问题