Keep coming back to this and cannot figure it out... I am creating an app for work that essentially compiles all of our tools into one easier to use GUI. One of the tools we use is something we use from a 3rd party and is hosted as a Remote App via RDWeb. Now I also have just regular remote desktop access as well and I can access the desktop via my Winform using MSTSC and this process which works beautifully. I am curious if it is possible to just load the RemoteAPP and not the entire desktop in the MSTSC control so that my users aren't getting to the full desktop. Or if there is any other way to host a RemoteAPP Only within Winforms.
I have reviewed the MSDN documentation on ITSRemoteProgram but when I try the following it just throws an exception.The debugger stops at rdp.RemoteProgram.RemoteProgramMode = true;
and gives an HRESULT E_FAIL exception.
I have also tried using the remoteprogram
after the OnConnected event fires and I get the same results.
try
{
rdp.Server = "FFWIN2008R2DC.fflab123.net";
rdp.Domain = "fflab123";
rdp.UserName = "administrator";
IMsTscNonScriptable secured = (IMsTscNonScriptable)rdp.GetOcx();
secured.ClearTextPassword = "password123";
rdp.OnConnected += rdp_OnConnected;
rdp.RemoteProgram.RemoteProgramMode = true;
rdp.RemoteProgram2.RemoteApplicationName = "Calculator";
rdp.RemoteProgram2.RemoteApplicationProgram = @"C:\Windows\system32\calc.exe";
rdp.Connect();
}
catch (Exception Ex)
{
MessageBox.Show("Error Connecting", "Error connecting to remote desktop " + " Error: " + Ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Perhaps I am going at this the wrong way or perhaps its not even possible. I would just like a nudge in the correct direction I dont need anyone to write this for me.