Click to See Complete Forum and Search --> : Popup menu?
vbuser
Nov 5th, 1999, 10:42 PM
Help me, please, I don't know how to disable the popup menu in the webbrowser control.
Thanks for any help.
Jessie
Nov 6th, 1999, 12:14 AM
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
Jessie
Nov 6th, 1999, 12:21 AM
hmmm might also be java it one or the other i
i forget now
Compwiz
Nov 6th, 1999, 12:34 AM
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
tom@e-bizinternet.com
ICQ: 15743470
AIM: TomY10
PERL, JavaScript and VB Programmer
[This message has been edited by Compwiz (edited 11-06-1999).]
Yonatan
Nov 6th, 1999, 12:53 AM
Try this:
Module 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...
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: RZvika@netvision.net.il
ICQ: 19552879 (http://www.icq.com/19552879)
Mark Sreeves
Nov 7th, 1999, 03:38 PM
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/kb/articles/Q183/2/35.ASP
(or I could email it to you!)
------------------
Mark Sreeves
Analyst Programmer
Mark.Sreeves@Softlab.co.uk
A BMW Group Company
[This message has been edited by Mark Sreeves (edited 11-08-1999).]
Denpong
Feb 12th, 2000, 03:48 PM
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????
Mass
Aug 15th, 2000, 06:42 PM
I get an error when my program reaches
If (IsWindow(m_lhWnd) <> 0)
and can you please tell me what dose it do?
Thanks
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.