Results 1 to 2 of 2

Thread: Right Click on WebBrowser

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Posts
    19

    Question

    I have found many snippets of code explaining how to change the right click menus of forms, textboxes, etc, but I can't for the life of me find a way to get a WebBrowser right click menu to change. This is due to the lack of a WebBrowser_Mousedown() subfunction. Does anyone have any ideas on how to modify a WebBrowser's Right Click menu?
    - Jason Fryes
    False Reality Productions

    "History is a set of lies agreed upon."
    - Napoleon Bonaparte

  2. #2
    Guest
    To remove Right Click menu from WebBrowser Control:

    http://support.microsoft.com/suppor...s/Q183/2/35.ASP
    http://msdn.microsoft.com/downloads...izer/sample.asp


    And use the GetCursorPos API function to get where the cursor is which will be needed for when you use the GetAsyncKeyState API function to tell whether the mouse button has been right clicked on the WebBrowser Control.


    Code:
    Private Type POINTAPI
        X As Long
        Y As Long
    End Type
    
    Private Declare Function GetCursorPos _
    Lib "user32" (lpPoint As POINTAPI) As Long
    
    
    Usage
    
    
    Private Sub Command1_Click()
    
        Dim PT As POINTAPI
        GetCursorPos PT
        MsgBox "(" & PT.x & "," & PT.y & ")"
    
    End Sub


    Code:
    Private Declare Function GetAsyncKeyState Lib "user32" _
    (ByVal vKey As Long) As Integer
    
    
    Usage
    
    
    Private Sub Command1_Click()
        
        If GetAsyncKeyState(vbRightButton) Then _
        Msgbox "Right mouse button clicked"
    
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width