Help me, please, I don't know how to disable the popup menu in the webbrowser control.
Thanks for any help.
Printable View
Help me, please, I don't know how to disable the popup menu in the webbrowser control.
Thanks for any help.
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
hmmm might also be java it one or the other i
i forget now
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).]
Try this:
Module Code...
Form 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
------------------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
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).]
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????
I get an error when my program reaches
If (IsWindow(m_lhWnd) <> 0)
and can you please tell me what dose it do?
Thanks