I'm looking for a function that could perform a fast user switching. Something like ExitWindowsEx() or InitiateShutdown(). I searched in MSDN but I could find anything useful. The only thing was that: http://msdn.microsoft.com/en-us/library/windows/desktop/bb776893%28v=vs.85%29.aspx but there is nothing how to do it programically. Thanks in advance.
Asked
Active
Viewed 893 times
3
-
where do you want to switch users? – Math Oct 08 '13 at 17:09
-
What do you mean by "where"? – Avert Oct 08 '13 at 17:11
-
I think I got it now.. You want to switch windows users via an C++ app, right? – Math Oct 08 '13 at 17:12
-
Yes. I want my C++ app to call windows to open fast user switching screen. Something similar to what LockWorkStation() does. – Avert Oct 08 '13 at 17:15
-
What is wrong with `LockWorkStation()`? It seems like it is exactly what you are asking for. – Math Oct 08 '13 at 17:22
-
LockWorkStation() does something the same job like clicking "Lock" button on Menu Start. I look for something that would work like clicking "Switch user" button. – Avert Oct 08 '13 at 17:27
1 Answers
2
Fast User Switching is implemented via Remote Desktop Services (used to be called Terminal Services), so to initiate the switching screen it's simply a matter of disconnecting the current session:
WTSDisconnectSession(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, FALSE);

Jonathan Potter
- 36,172
- 4
- 64
- 79