WTSEnumerateSessions and Welcome Screen

From: flat_ross (flat_ross_at_yahoo.com)
Date: 03/24/05

Date: 24 Mar 2005 01:34:57 -0800


If there is a better NG for this, please let me know.

I have WTSEnumerateSessions working with WTSEnumerateProcesses to get
all Terminal Services users. I match up the unique process users'
sessions from WTSEnumerateProcesses with the SessionInfo structures
returned from WTSEnumerateSessions. I then check the Status and
WinStation to see if a session is active.

However, when I go Start -> LogOff to bring up the Welcome Screen,
terminal services is still reporting the session status as Active and
the station as Console. So I guess the Welcome Screen belongs to the
last user and it is not its own session. But I need to know that XP is
sitting on the Welcome Screen and therefore all users are disconnected
(from my perspective).

If the only answer is WTSRegisterSessionNotification, then may someone
supply either a CSharp or VB.NET example as I only have been able to
find CPP examples. Or if CPP is the only way perhaps a full project I
could just slap into VS7 and compile?