none
C# Open remote application locked within Windows form

    Question

  • We're developing a C# Windows application, and one of the things we want to do with it is open a remote application inside our program. We can open a connection to the application's server using MSTSCLib, but to open our remote application either we open a remote desktop connection and open the program (which we don't want to do) or we open the remote application but in a separate window (which also isn't ideal).

    This is how we get the remote application to open in a new window; is there a way to open the remote application inside the RDP client?

    private AxMSTSCLib.AxMsRdpClient9NotSafeForScripting rdp;

    rdp.RemoteProgram2.RemoteProgramMode = true; rdp.OnConnected += (_1, _2) => { rdp.RemoteProgram2.ServerStartProgram(@"C:\Windows\System32\calc.exe", "", "%SYSTEMROOT%", true, "", false); }; rdp.Server = "servername.com"; rdp.UserName = "domain\\user"; rdp.AdvancedSettings7.PublicMode = false; rdp.AdvancedSettings7.ClearTextPassword = "password";

    rdp.Connect();

    Monday, January 18, 2016 4:36 PM

Answers


  • Hi,

    We are not familiar with C#, here is a dedicated C# forum below for you.

    https://social.msdn.microsoft.com/Forums/en-us/home?forum=csharpgeneral

    is there a way to open the remote application inside the RDP client?

    As far as I know, when we open a application installed on remote host as either remote program via mstsc.exe or RemoteApp application via RD Web Access, it's actually treated as single remote session even though only one application is opened.

    Best Regards,
    Amy


    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by ptellerh Tuesday, January 19, 2016 4:26 PM
    Tuesday, January 19, 2016 3:06 PM
    Moderator

All replies


  • Hi,

    We are not familiar with C#, here is a dedicated C# forum below for you.

    https://social.msdn.microsoft.com/Forums/en-us/home?forum=csharpgeneral

    is there a way to open the remote application inside the RDP client?

    As far as I know, when we open a application installed on remote host as either remote program via mstsc.exe or RemoteApp application via RD Web Access, it's actually treated as single remote session even though only one application is opened.

    Best Regards,
    Amy


    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by ptellerh Tuesday, January 19, 2016 4:26 PM
    Tuesday, January 19, 2016 3:06 PM
    Moderator
  • Thanks, I'll try the forum you suggested.
    Tuesday, January 19, 2016 4:26 PM
  • we have tried same code as written by you. but after rdp connection. it automatically sign out from remote.

    we tried to connect from window10 to window10 rdp.  if we comment serverStartProgram. then application connects with remote desktop perfectly. 

    i am tring to open remote app using mstsclib. but not able to even open in new window. can you please help to solve this issue.

    Thanks in advance.

    Friday, July 13, 2018 4:57 AM