Can't a remote APP using AxMsRdpClient11NotSafeForScripting be moved to a 2nd left screen with different scale?

Arnau Pla 0 Reputation points
2025-02-07T08:29:06.56+00:00

In my .NET Framework 4.8 project, I am using the class AxMsRdpClient11NotSafeForScripting from the AxMSTSCLib library to open a remote app. I have a second screen on the left where I can't drag the app to. I can only move it if the two screens have the same scale or if the second screen is located on the right side. Is there a way it could work on the left side and with different scales?I have tried the following:

  1. I have changed this:
rdpclient.DesktopWidth = System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Width
rdpclient.DesktopHeight = System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Height

To this:

rdpclient.DesktopWidth = System.Windows.Forms.SystemInformation.VirtualScreen.Width
rdpclient.DesktopHeight = System.Windows.Forms.SystemInformation.VirtualScreen.Height

And this:

rdpclient.DesktopWidth = ClientRectangle.Width
rdpclient.DesktopHeight = ClientRectangle.Height
  1. In app.config, I added:
  <windowsSettings>
  	<application>
  		<dpiAware>true/PM</dpiAware>
  	</application>
  </windowsSettings>
  1. In the app.manifest file I added:
<windowsSettings>
	<dpiAware>true/PM</dpiAware>
</windowsSettings>		

Nothing worked.

Remote Desktop
Remote Desktop
A Microsoft app that connects remotely to computers and to virtual apps and desktops.
4,709 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,778 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Jiachen Li-MSFT 33,446 Reputation points Microsoft Vendor
    2025-02-07T09:07:36.4466667+00:00

    Hi @Arnau Pla,

    Try setting the Per-Monitor and Per-Monitor (V2) DPI Awareness.

    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
      <application xmlns="urn:schemas-microsoft-com:asm.v3">
        <windowsSettings>
          <dpiAware>true/PM</dpiAware>
          <dpiAwareness>PerMonitorV2</dpiAwareness>
        </windowsSettings>
      </application>
    </assembly>
    
    

    Best Regards.

    Jiachen Li


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Arnau Pla 0 Reputation points
    2025-02-07T11:33:41.6166667+00:00

    Hi @Jiachen Li-MSFT ,

    Thank you for answering. I have tried it, but it hasn't solved it. Are you sure it is not a bug? I say that because it works well except for this very specific case.

    Regards,
    Arnau Pla

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.