Example #1
0
 public bool TranslateAccelarator(NativeMethods.COMMSG msg)
 {
     if (this.activeObject != null)
     {
         if (this.activeObject.TranslateAccelerator(msg) != NativeMethods.S_FALSE)
         {
             return(true);
         }
     }
     return(false);
 }
Example #2
0
        public override bool PreProcessMessage(ref Message m)
        {
            bool handled = false;

            if ((m.Msg >= NativeMethods.WM_KEYFIRST) && (m.Msg <= NativeMethods.WM_KEYLAST))
            {
                // If it's a key down, first see if the key combo is a command key
                if (m.Msg == NativeMethods.WM_KEYDOWN)
                {
                    handled = ProcessCmdKey(ref m, (Keys)(int)m.WParam | ModifierKeys);
                }

                if (!handled)
                {
                    int keyCode = (int)m.WParam;

                    // Don't let Trident eat Ctrl-PgUp/PgDn
                    if (((keyCode != (int)Keys.PageUp) && (keyCode != (int)Keys.PageDown)) || ((ModifierKeys & Keys.Control) == 0))
                    {
                        NativeMethods.COMMSG cm = new NativeMethods.COMMSG();
                        cm.hwnd    = m.HWnd;
                        cm.message = m.Msg;
                        cm.wParam  = m.WParam;
                        cm.lParam  = m.LParam;

                        handled = this.site.TranslateAccelarator(cm);
                    }
                    else
                    {
                        // WndProc for Ctrl-PgUp/PgDn is never called so call it directly here
                        this.WndProc(ref m);
                        handled = true;
                    }
                }
            }

            if (!handled)
            {
                handled = base.PreProcessMessage(ref m);
            }

            return(handled);
        }
Example #3
0
 int NativeMethods.IDocHostUIHandler.TranslateAccelerator(NativeMethods.COMMSG msg, ref Guid group, int nCmdID)
 {
     return(NativeMethods.S_FALSE);
 }
Example #4
0
 int NativeMethods.IOleInPlaceFrame.TranslateAccelerator(NativeMethods.COMMSG lpmsg, short wID)
 {
     return(NativeMethods.S_FALSE);
 }