public override bool PreProcessMessage(ref Message msg)
        {
            bool handled = false;
            if ((msg.Msg >= WindowsMessages.WM_KEYFIRST) && (msg.Msg <= WindowsMessages.WM_KEYLAST_NT501))
            {
                // If it's a key down, first see if the key combo is a command key
                if (msg.Msg == WindowsMessages.WM_KEYDOWN)
                {//ghm reeditwin
                    
                    handled = ProcessCmdKey(ref msg, (Keys)(int)msg.WParam | ModifierKeys);
                }

                if (!handled)
                {
                    

                    int keyCode = (int)msg.WParam;
                    // Don't let Trident eat Ctrl-PgUp/PgDn
                    if (((keyCode != (int)Keys.PageUp) && 
                        (keyCode != (int)Keys.PageDown)) || 
                        ((ModifierKeys & Keys.Control) == 0))
                    {
                        tagMSG cm = new tagMSG();

                        cm.hwnd = msg.HWnd;
                        cm.message = msg.Msg;
                        cm.wParam = msg.WParam;
                        cm.lParam = msg.LParam;

                        IOleInPlaceActiveObject accele = m_WBUnknown as IOleInPlaceActiveObject;
                        if( (accele != null) && 
                            (accele.TranslateAccelerator(ref cm) == Hresults.S_OK) )
                            handled = true;
                    }
                    else
                    {
                        // WndProc for Ctrl-PgUp/PgDn is never called so call it directly here
                        WndProc(ref msg);
                        handled = true;
                    }
                }
            }
            if (!handled)
            {
                handled = base.PreProcessMessage(ref msg);
            }
            return handled;
        }
        int IDocHostUIHandler.TranslateAccelerator(ref tagMSG msg, ref Guid group, uint nCmdID)
        {
            //    return Hresults.S_OK; //Cancel
            //    return Hresults.S_FALSE; //IE default action
            Keys nVirtExtKey = Keys.None; // (int)0;
            if ((ModifierKeys & Keys.Control) != 0)
                nVirtExtKey = Keys.ControlKey; //CONTROL 17
            if ((ModifierKeys & Keys.ShiftKey) != 0)
                nVirtExtKey = Keys.ShiftKey; //SHIFT 16
            if ((ModifierKeys & Keys.Menu) != 0)
                nVirtExtKey = Keys.Menu; //ALT 18
            Keys keyCode = (Keys)msg.wParam;

            if ((msg.message == WindowsMessages.WM_KEYDOWN) && (WBKeyDown != null))
            {
                if (nCmdID == 17)
                { // ghm delete
                    if (this.deleteFunc())
                        return Hresults.S_OK;
                }
                if(this.canBeEditFunc() == false)
                    return Hresults.S_FALSE;

                WBKeyDownEvent.SetParameters(keyCode, nVirtExtKey);
                WBKeyDown(this, WBKeyDownEvent);
                if (WBKeyDownEvent.handled)
                    return Hresults.S_OK;
            }
            if ((msg.message == WindowsMessages.WM_KEYUP) && (WBKeyUp != null))
            {
                if (this.canBeEditFunc() == false)
                    return Hresults.S_FALSE;

                WBKeyUpEvent.SetParameters(keyCode, nVirtExtKey);
                WBKeyUp(this, WBKeyUpEvent);
                if (WBKeyUpEvent.handled == true)
                    return Hresults.S_OK;
            }
            //IE default action
            return Hresults.S_FALSE;
        }