PDA

Click to See Complete Forum and Search --> : help.. please?


Z
Oct 27th, 1999, 09:44 AM
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

richie
Oct 27th, 1999, 10:24 PM
I don't know about that, but if you're a serious developer there's a great browser control at www.homepagesoftware.com. (http://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.

Serge
Oct 28th, 1999, 06:10 AM
Sure thing:

Module 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:


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
Serge_Dymkov@vertexinc.com
Access8484@aol.com

Alex1973
Jan 20th, 2000, 03:47 PM
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.