If you ever worked with the
RemoteDesktop
Client from Microsoft, you probably ran into this bug.
When selecting another component on your application, the client of course loses focus, but when you want to select the client component again, the only way is to use the TAB button, you won't be able to select the client component with the mouse button, so here's a fix. ;)
public class MsRdpClient2 : AxMSTSCLib.AxMsRdpClient2
{
public MsRdpClient2()
: base()
{
}
protected override void WndProc(ref System.Windows.Forms.Message m)
{
if (m.Msg == 0x0021)
this.Focus();
base.WndProc(ref m);
}
}
public class MsRdpClient3 : AxMSTSCLib.AxMsRdpClient3
{
public MsRdpClient3()
: base()
{
}
protected override void WndProc(ref System.Windows.Forms.Message m)
{
if (m.Msg == 0x0021)
this.Focus();
base.WndProc(ref m);
}
}
public class MsRdpClient4 : AxMSTSCLib.AxMsRdpClient4
{
public MsRdpClient4()
: base()
{
}
protected override void WndProc(ref System.Windows.Forms.Message m)
{
if (m.Msg == 0x0021)
this.Focus();
base.WndProc(ref m);
}
}
public class MsRdpClient5 : AxMSTSCLib.AxMsRdpClient5
{
public MsRdpClient5()
: base()
{
}
protected override void WndProc(ref System.Windows.Forms.Message m)
{
if (m.Msg == 0x0021)
this.Focus();
base.WndProc(ref m);
}
}
public class MsRdpClient6 : AxMSTSCLib.AxMsRdpClient6
{
public MsRdpClient6()
: base()
{
}
protected override void WndProc(ref System.Windows.Forms.Message m)
{
if (m.Msg == 0x0021)
this.Focus();
base.WndProc(ref m);
}
}
public class MsRdpClient7 : AxMSTSCLib.AxMsRdpClient7
{
public MsRdpClient7()
: base()
{
}
protected override void WndProc(ref System.Windows.Forms.Message m)
{
if (m.Msg == 0x0021)
this.Focus();
base.WndProc(ref m);
}
}