Results 1 to 4 of 4

Thread: help.. please?

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 1999
    Posts
    3

    Post

    Can someone tell me if there is a way to turn off the popup menu on the web browser control? (happens when you right click it)

    Or any way to stop it from appearing?

    Thanks, Z


  2. #2
    Member
    Join Date
    May 1999
    Posts
    49

    Post

    I don't know about that, but if you're a serious developer there's a great browser control at www.homepagesoftware.com. (I think that's the address. If not, just type 'Webster pro' in any search engine). You can disable the right click in that - can even make you're own menu. You can download a free demo - and best of all you don't have to impose IE on your end users.

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Sure thing:

    Module code:
    Code:
    Public Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
    Public Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
    Public Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal nCode As Long, ByVal wParam As Long, lparam As Any) As Long
    Public Declare Function GetCurrentThreadId Lib "kernel32" () As Long
    Public Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
    Public Const WM_RBUTTONUP = &H205
    Public Const WH_MOUSE = 7
    Public Type POINTAPI
        x As Long
        y As Long
    End Type
    Public Type MOUSEHOOKSTRUCT
        pt As POINTAPI
        hwnd As Long
        wHitTestCode As Long
        dwExtraInfo As Long
    End Type
    Public g_lngMouseHook As Long
        
    Public Function MouseHookProc(ByVal nCode As Long, ByVal wParam As Long, structMouseHook As MOUSEHOOKSTRUCT) As Long
        Dim strBuffer As String
        Dim lngBufferLen As Long
        Dim strClassName As String
        Dim lngResult As Long
        
        If (nCode >= 0 And wParam = WM_RBUTTONUP) Then
                strBuffer = Space(255)
                'This is the class name for IE
                strClassName = "Internet Explorer_Server"
                'Get the classname for the Window that has been clicked
                lngResult = GetClassName(structMouseHook.hwnd, strBuffer, Len(strBuffer))
                If lngResult > 0 Then
                    'Check to see if the class of the window we clicked on
                    'is the same as IE's class
                    If Left$(strBuffer, lngResult) = strClassName Then
                        MouseHookProc = 1
                        Exit Function
                    End If
                End If
            End If
        MouseHookProc = CallNextHookEx(g_lngMouseHook, nCode, wParam, structMouseHook)
    End Function

    Form Code:

    Code:
    Private Sub Form_Load()
        WebBrowser.Navigate "http://www.vb-world.net"
        gLngMouseHook = SetWindowsHookEx(WH_MOUSE, AddressOf MouseHookProc, App.hInstance, GetCurrentThreadId)
    End Sub

    Regards,

    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]



  4. #4
    New Member
    Join Date
    Jan 2000
    Location
    Romania
    Posts
    6

    Post

    Can I add my own pop-up menu? How do I know if the mouse is over a link so my menu can depend on that?
    Thank you.

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