locked
WindowsFormsHosted RDP control in WPF mouse click does not work. RRS feed

  • Question

  • I'm trying to host the ActiveX RDP control in WPF.  Using the code below the RDP session connects when the connect button is pressed and you can see the screen.  You can hover the mouse over the remote desktop objects and see their tooltips but you can't click on anything? 

     

    While debugging I did experience one session where I could click and it acted as expected but I was unable to reproduce this behavior.

     

    Thanks

    Craig.

     

    <Window x:Class="Nstrument.Portal.Controls.Rdp"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Title="Rdp" Height="900" Width="910">

    <StackPanel Name="panel">

    <Button Name="connect"></Button>

    </StackPanel>

    </Window>

     

     

    public partial class Rdp : Window {

    AxMSTSCLib.AxMsRdpClient2 _rdp;

     

    public Rdp() {

    InitializeComponent();

    _rdp = new AxMSTSCLib.AxMsRdpClient2();

    WindowsFormsHost formsHost = new WindowsFormsHost();

    formsHost.Width = 900;

    formsHost.Height = 700;

    formsHost.Child = _rdp;

    this.panel.Children.Add(formsHost);

    this.connect.Click += new RoutedEventHandler(connect_Click);

    }

     

    void connect_Click(object sender, RoutedEventArgs e) {

    _rdp.Domain = "domain";

    _rdp.UserName = "username";

    _rdp.AdvancedSettings2.ClearTextPassword = "pwd";

    _rdp.Server = "192.168.1.100";

    _rdp.Connect();

    }

    }

    Wednesday, January 23, 2008 1:59 AM

All replies

  •  termServ.Connect();

    windowsFormsHost1.Focus();

    Solves your problem.

    But I have my own problem: I want to launch notepad.exe , like this

    termServ.SecuredSettings2.StartProgram = @"C:\Windows\Notepad.exe";

    It does not launch. reason being my termServ.SecuredSettingsEnabled is -1. I dont know how to enable this setting?

    Friday, January 30, 2009 5:55 PM
  • This is working but i can't do anyting in remote screen neither wit mouse nor keyboard.
    Wednesday, August 8, 2012 9:21 AM