Fix the focus issue on RDP Client from the AxInterop.MSTSCLib.dll





5.00/5 (1 vote)
public class MsTSCLib2 : AxMSTSCLib.AxMsTscAxNotSafeForScripting{ public MsTSCLib2() : base() { } protected override void WndProc(ref System.Windows.Forms.Message m) { //Fix for the missing focus issue on the rdp client component if (m.Msg ==...
public class MsTSCLib2 : AxMSTSCLib.AxMsTscAxNotSafeForScripting
{
public MsTSCLib2() : base()
{
}
protected override void WndProc(ref System.Windows.Forms.Message m)
{
//Fix for the missing focus issue on the rdp client component
if (m.Msg == 0x0021)
//WM_MOUSEACTIVATE ref:http://msdn.microsoft.com/en-us/library/ms645612(VS.85).aspx
this.Focus();
base.WndProc(ref m);
}
}