hi,
I want to share a fix rectangle area of my desktop(sharer) to my viewer, and the viewer can control(mouse and keyboard) this fixed shared area. i have finished it by using RDPSession an RDPViewer, that is supplied by AxInterop.RDPCOMAPILib.
But, when the viewer try to control the sharer, the delay of operations(both mouse and keyboard) is very high. when i try to use mstc.exe to do this directly, no delay of operations.
1、How can i fix the high delay of operation by using RDPSession or RDPViewer?
2、If the delay between the RDPSession and RDPViewer can't be reduce, is there some other way to share and control a fix rectangle area of my desktop?
the following is my code:
private void shareButton_Click(object sender, EventArgs e) { Rectangle rect = Screen.GetBounds(this); m_rdpSession = new RDPSession(); m_rdpSession.OnAttendeeConnected += m_rdpSession_OnAttendeeConnected; Rectangle shareArea = new Rectangle(axRDPViewer1.Location.X, axRDPViewer1.Location.Y, axRDPViewer1.ClientRectangle.Width, axRDPViewer1.ClientRectangle.Height); m_rdpSession.SetDesktopSharedRect(shareArea.Left, shareArea.Top, shareArea.Right, shareArea.Bottom); m_rdpSession.Open(); IRDPSRAPIInvitation invitation = m_rdpSession.Invitations.CreateInvitation("baseAuth", "groupName", "", 64); textBox2.Text = invitation.ConnectionString; } void m_rdpSession_OnAttendeeConnected(object pAttendee) { //viewer can contorl sharing area IRDPSRAPIAttendee att = pAttendee as IRDPSRAPIAttendee; att.ControlLevel = CTRL_LEVEL.CTRL_LEVEL_INTERACTIVE; }
and the viewer:
private void button1_Click(object sender, EventArgs e) { axRDPViewer1.Connect(textBox1.Text.Trim(), Environment.UserName, ""); }