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.





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



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

    <StackPanel Name="panel">

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





    public partial class Rdp : Window {

    AxMSTSCLib.AxMsRdpClient2 _rdp;


    public Rdp() {


    _rdp = new AxMSTSCLib.AxMsRdpClient2();

    WindowsFormsHost formsHost = new WindowsFormsHost();

    formsHost.Width = 900;

    formsHost.Height = 700;

    formsHost.Child = _rdp;


    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 = "";




    Wednesday, January 23, 2008 1:59 AM

All replies

  •  termServ.Connect();


    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