Internet Explorer Toolbar Tab Key

I wrote an IE toolbar in C # and everything works just fine, except when I open a Windows child form from my toolbar, the tab key does not work on the child form to allow me to move from field to field.

The interesting part is that when I open my child form using form.showDialog () instead of form.show (), the tabs work as usual.

Created toolbar based on this article and article

I implemented TranslateAcceleratorIO, as mentioned in several articles, but still no luck.

Here are my TranslateAcceleratorIO () and HasFocusIO () applications (implemented in my dashboard class)

        [DllImport("user32.dll")]
        public static extern int TranslateMessage(ref MSG lpMsg);

        [DllImport("user32", EntryPoint = "DispatchMessage")]
        static extern bool DispatchMessage(ref MSG msg);

        public int HasFocusIO()
        {                            
            return this.ContainsFocus ? 0 : 1; //S_OK : S_FALSE;
        }

        public int TranslateAcceleratorIO(ref MSG msg)
        {                
            if (msg.message == 0x100)//WM_KEYDOWN
                if (msg.wParam == (uint)Keys.Tab || msg.wParam ==(uint)Keys.F6)
                {
                    if (SelectNextControl(
                            ActiveControl,
                            ModifierKeys == Keys.Shift ? false : true,
                            true,
                            true,
                            false)
                        )
                    {
                        return 0;//S_OK
                    }
                }
                else
                {                        
                    TranslateMessage(ref msg);
                    DispatchMessage(ref msg);
                    return 0;//S_OK
                }
            return 1;//S_FALSE
        }

TranslateAccelerator, , :

   public int TranslateAcceleratorIO(ref MSG msg)
    {

        TranslateMessage(ref msg);
        DispatchMessage(ref msg);
        return 0;//S_OK
    }

- ?

+3
2

HasFocusIO? , HasFocusIO true.

IE . , , . , HasFocusIO TranslateAcceleratorIO .

+1

? , , ?

DeskBand, HasFocusIO true, ( ). Tab, Delete, .. TranslateAcceleratorIO, , .

IE .

0

Source: https://habr.com/ru/post/1698498/


All Articles