65.9K
CodeProject is changing. Read more.
Home

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

starIconstarIconstarIconstarIconstarIcon

5.00/5 (1 vote)

Oct 18, 2011

CPOL
viewsIcon

12520

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);
    }
}