Comment #1 on issue 2 by danpo...@gmail.com: Add support for session change
notifications
http://code.google.com/p/cassia/issues/detail?id=2
You can already receive session change notifications in services (via
ServiceBase.OnSessionChange), which is where notifications are usually most
useful, so I don't think this is a high priority.
Issue 47 has been merged into this issue.
WTSRegisterSessionNotificationEx (which allows monitoring of remote RD
servers) requires Vista/2008. On older platforms, it may be possible to
work around this using an undocumented function in winsta.dll, but I
wouldn't count on that being easy to implement.
WTSWaitSystemEvent is another option, but the function is riddled with bugs
-- sometimes notifications are dispatched twice, sometimes the
WTS_EVENT_FLUSH value doesn't work. But it's a possibility for supporting
remote XP/2003 session notifications.
See:
-
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383856(v=vs.85).aspx
- http://www.remkoweijnen.nl/blog/2008/01/25/using-wtswaitsystemevent/
Comment #5 on issue 2 by danports: Add support for session change
notifications
http://code.google.com/p/cassia/issues/detail?id=2
(No comment was entered for this change.)
Comment #6 on issue 2 by danports: Add support for session change
notifications
http://code.google.com/p/cassia/issues/detail?id=2
Use the same technique the Microsoft.Win32.SystemEvents class uses to
create a hidden window to receive the relevant messages. WTSWaitSystemEvent
doesn't provide as much information as WTSRegisterSessionNotificationEx. We
could support WTSRegisterSessionNotification for local notifications on
XP/2003, but it's probably not worth supporting notifications for remote
systems on those platforms (unless we can dig up the relevant internal API
easily -- XP/2003 are in the extended support phase already). There's
WinStationRegisterNotificationEvent in winsta.dll, but it's not clear how
that works without doing some spelunking.