Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Win32 API to Disconnect User (like from Task Manager)

Hello all!

I'm looking for an API function that I can use to perform the "Disconnect User" function in Windows XP. What I'm exactly referring to is the action that happens after you click the button "Disconnect" if you are in the Users tab of the Task Manager. Please see attached image...

Does anyone have any ideas on what I can use to get this done?

Every resource I check for user32.dll doesn't seem to have anything explicitly related to this. I thought about trying to somehow use CloseDesktop and see if that would work, but haven't had time to fiddle with it yet.
[621 byte] By [wicki] at [2007-11-11 7:40:40]
# 1 Re: Win32 API to Disconnect User (like from Task Manager)
OK, I think I may have this one. This using multiple "users" is actually using Terminal Server functionality, so if I just pull things from the Terminal Server API (such as WTSDisconnectSession), it seems to be working out. :)
wicki at 2007-11-11 17:26:32 >