public bool OnKeystrokeMessageForAddon(Visio.MSGWrap msgWrap) { System.Windows.Forms.Message msg = new System.Windows.Forms.Message(); msg.Msg = msgWrap.message; msg.WParam = (IntPtr)msgWrap.wParam; msg.LParam = (IntPtr)msgWrap.lParam; ThisAddIn.addinApplication.frmBabylonPanel.webBrowserBabylon.PreProcessMessage(ref msg); return(true); }
public bool OnKeystrokeMessageForAddon(Visio.MSGWrap msgWrap) { var keys = (Keys)msgWrap.wParam; if ((Control.ModifierKeys & Keys.Control) != 0) { keys |= Keys.Control; } if ((Control.ModifierKeys & Keys.Shift) != 0) { keys |= Keys.Shift; } var control = Control.FromChildHandle((IntPtr)msgWrap.hwnd) as WebBrowser; if (control == null) { return(false); } if (ControlShortcutKeys.Contains(keys)) { var msg = new Win32.MSG { hwnd = (IntPtr)msgWrap.hwnd, message = (UInt32)msgWrap.message, wParam = (IntPtr)msgWrap.wParam, lParam = (IntPtr)msgWrap.lParam }; var accel = (Win32.IOleInPlaceActiveObject)control.ActiveXInstance; if (accel.TranslateAccelerator(ref msg) == 0) { Win32.TranslateMessage(ref msg); } Win32.DispatchMessage(ref msg); return(true); } return(false); }