How to connect to a remote desktop in 'span' mode

1k views Asked by At

I am looking for some documentation or some code example to connect to a remote desktop using C# MSTSCLib and AxMSTSCLib while displaying the created window in 'span' mode when using multiple screens. I would like to get the equivalent of the command:

mstsc /span remote_ip

I only found this link Where can I find documentation on the C# MSTSCLib, specifically the MsRdpClient classes? but it did not help me much. I am already able to connect to a remote desktop by calling

connect()

on a

AxMsRdpClient2

object. There are a lot of settings that can be modified to tune the behaviour or this object (authentication, etc) but I cannot find how to display the result in a window that fills multiple screens instead of only one screen.

1

There are 1 answers

0
user2814627 On

I managed to do what I wanted. The only trick is to set the following properties:

_axMsRdpClient.DesktopWidth = ClientRectangle.Width;

_axMsRdpClient.DesktopHeight = ClientRectangle.Height;

_axMsRdpClient.AdvancedSettings3.SmartSizing = true;

before calling

connect()

Once this method is called I do not think it is possible to change the size of the remote desktop.