Results 1 to 8 of 8

Thread: Popup menu?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Location
    US
    Posts
    3

    Post

    Help me, please, I don't know how to disable the popup menu in the webbrowser control.

    Thanks for any help.

  2. #2
    Lively Member
    Join Date
    Nov 1999
    Location
    Calgary,Alberta, Canada
    Posts
    70

    Post

    all you have to do is go into your preferences and disable the javascript
    this will prevent popups from happening
    i'm not sure whatelse this will effect when surfing

  3. #3
    Lively Member
    Join Date
    Nov 1999
    Location
    Calgary,Alberta, Canada
    Posts
    70

    Post

    hmmm might also be java it one or the other i
    i forget now

  4. #4
    Hyperactive Member
    Join Date
    Jul 1999
    Location
    NY, USA
    Posts
    270

    Post

    Jessie: vbuser means he wants the pop-up menu to be disabled, not pop-up windows (or atleast that is how it is worded). However, I'm really not sure how to do this.

    ------------------
    Tom Young, 14 Year Old
    [email protected]
    ICQ: 15743470
    AIM: TomY10
    PERL, JavaScript and VB Programmer

    [This message has been edited by Compwiz (edited 11-06-1999).]

  5. #5
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    Try this:
    Module Code...
    Code:
    Option Explicit
    
    
    Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Declare Function IsWindow Lib "user32" (ByVal hWnd As Long) As Long
    Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    
    
    Private Const GWL_WNDPROC = (-4)
    Public Const WM_MOUSEACTIVATE = &H21
    Public Const MA_ACTIVATEANDEAT = 2
    
    
    Private lpfnPreviousWindowProcedure As Long
    Private m_lhWnd As Long
    
    
    Private Function WindowProcedure(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
        If (uMsg = WM_MOUSEACTIVATE) And (lParam = &H2040001) Then ' Don't ask about the lParam...
            WindowProcedure = MA_ACTIVATEANDEAT
            Exit Function
        End If
        WindowProcedure = CallWindowProc(lpfnPreviousWindowProcedure, hWnd, uMsg, wParam, lParam)
    End Function
    
    
    Public Sub Hook(ByVal lhWnd As Long)
        If (IsWindow(m_lhWnd) <> 0) Or (IsWindow(lhWnd) = 0) Then Exit Sub
        m_lhWnd = FindWindowEx(lhWnd, 0, "Shell Embedding", vbNullString)
        lpfnPreviousWindowProcedure = SetWindowLong(m_lhWnd, GWL_WNDPROC, AddressOf WindowProcedure)
    End Sub
    
    
    Public Sub Unhook()
        Call SetWindowLong(m_lhWnd, GWL_WNDPROC, lpfnPreviousWindowProcedure)
        m_lhWnd = 0
    End Sub
    Form Code...
    Code:
    Private Sub Form_Load()
        Call Hook(hWnd)
    End Sub
    
    
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
        Call Unhook
    End Sub
    ------------------
    Yonatan
    Teenage Programmer
    E-Mail: [email protected]
    ICQ: 19552879



  6. #6
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    Microsoft very kindly wrote

    WBCustomizer.dll

    which has several functions to limit (further!) a webbrowser control's functionallity such as disabling context menus and shortcut keys

    WBCustom.exe has a working example in vb and is available from:


    http://support.microsoft.com/support.../Q183/2/35.ASP

    (or I could email it to you!)

    ------------------
    Mark Sreeves
    Analyst Programmer

    [email protected]
    A BMW Group Company


    [This message has been edited by Mark Sreeves (edited 11-08-1999).]

  7. #7
    New Member
    Join Date
    Feb 2000
    Location
    Klongkum,Bungkum Bangkok
    Posts
    4

    Post

    This promblem you're talking is not for me. My problem is how can I get the popup shotcut onkeybord to work with VB. Right now what I'm doing is check the mouse down events with the object. Can anyone suggest of how to do what I'm talking about????

  8. #8
    Addicted Member
    Join Date
    Jun 2000
    Posts
    175

    Getting Error

    I get an error when my program reaches

    If (IsWindow(m_lhWnd) <> 0)

    and can you please tell me what dose it do?

    Thanks
    Mass

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