|
-
Nov 5th, 1999, 11:42 PM
#1
Thread Starter
New Member
Help me, please, I don't know how to disable the popup menu in the webbrowser control.
Thanks for any help.
-
Nov 6th, 1999, 01:14 AM
#2
Lively Member
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
-
Nov 6th, 1999, 01:21 AM
#3
Lively Member
hmmm might also be java it one or the other i
i forget now
-
Nov 6th, 1999, 01:34 AM
#4
Hyperactive Member
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).]
-
Nov 6th, 1999, 01:53 AM
#5
Guru
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
-
Nov 7th, 1999, 04:38 PM
#6
Frenzied Member
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).]
-
Feb 12th, 2000, 04:48 PM
#7
New Member
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????
-
Aug 15th, 2000, 06:42 PM
#8
Addicted Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|