WTSStartRemoteControlSessionA function (wtsapi32.h)

Starts the remote control of another Remote Desktop Services session. You must call this function from a remote session.


BOOL WTSStartRemoteControlSessionA(
  LPSTR  pTargetServerName,
  ULONG  TargetLogonId,
  BYTE   HotkeyVk,
  USHORT HotkeyModifiers



A pointer to the name of the server where the session that you want remote control of exists.


The logon ID of the session that you want remote control of.


The virtual-key code that represents the key to press to stop remote control of the session. The key that is defined in this parameter is used with the HotkeyModifiers parameter.


The virtual modifier that represents the key to press to stop remote control of the session. The virtual modifier is used with the HotkeyVk parameter.

For example, if the WTSStartRemoteControlSession function is called with HotkeyVk set to VK_MULTIPLY and HotkeyModifiers set to REMOTECONTROL_KBDCTRL_HOTKEY, the user who has remote control of the target session can press CTRL + * to stop remote control of the session and return to their own session.


The SHIFT key


The CTRL key


The ALT key

Return value

If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is zero. To get extended error information, call GetLastError.



The wtsapi32.h header defines WTSStartRemoteControlSession as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.


Minimum supported client Windows Vista with SP1
Minimum supported server Windows Server 2008
Target Platform Windows
Header wtsapi32.h
Library Wtsapi32.lib
DLL Wtsapi32.dll