There is, since you handle it:
Also, as I mentioned before, the context-menu-key on the keyboard works fine.Code:Private Function WindowProcControl(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Select Case wMsg ... Case WM_VSCROLL, WM_HSCROLL ' The notification codes EN_HSCROLL and EN_VSCROLL are not sent when clicking the scroll bar thumb itself. If LoWord(wParam) = SB_THUMBTRACK Then RaiseEvent Scroll Case WM_CONTEXTMENU If wParam = RichTextBoxHandle Then Dim P As POINTAPI, Handled As Boolean P.X = Get_X_lParam(lParam) P.Y = Get_Y_lParam(lParam) If P.X > 0 And P.Y > 0 Then ScreenToClient RichTextBoxHandle, P RaiseEvent ContextMenu(Handled, UserControl.ScaleX(P.X, vbPixels, vbContainerPosition), UserControl.ScaleY(P.Y, vbPixels, vbContainerPosition)) ElseIf P.X = -1 And P.Y = -1 Then ' If the user types SHIFT + F10 then the X and Y coordinates are -1. RaiseEvent ContextMenu(Handled, -1, -1) End If If Handled = True Then Exit Function End If ... End Select ... End Sub




Reply With Quote