How to check that the system is in the "Logout" state?

I want to check if the system is in a logout state or not in VC ++, any ideas?

+3
c ++ windows winapi
source share
2 answers
  • You can receive notifications of registration / logout using various mechanisms (SENS, SCM Notifications if your program is a service, Winlogon notification if you are in XP)
  • You can use WMI to list active sessions.
  • You can use the WTS API to list sessions and retrieve request session information.
+4
source share

In AutoIt, I always find that the system logs out by checking the active window handle, if the system is registered in the active window handle, it returns 0x0000000. In AutoIt, it would look like ...

If WinGetHandle("") == 0x00000000 Then MsgBox(0,"","We are logged out!") 

Hope this helps ...

+3
source share

All Articles