Click here to Skip to main content
15,887,135 members
Articles / Programming Languages / C#
Alternative
Tip/Trick

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

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
18 Oct 2011CPOL 12.1K   2   1
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 ==...
C#
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);
    }
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Bluestone Consulting Group
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
AnswerThanks! Pin
Agustín Rodríguez23-Sep-13 6:51
Agustín Rodríguez23-Sep-13 6:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.