Page 1 of 1

Right Click on WebBrowser Object

PostPosted: Fri Oct 17, 2008 11:45 am
by David de Argentina
Hi Dave,

Sometimes allow the context menu on the WebBrowser Object is not a convenience.

But, sometimes we need our own context menu. It could be created using MenuEx or something like this...

I think if you coud add Right Click Event at WebBrowser Object actions it could be usefull

Could you consider add this capability ?

Thanks in advance,
David de Argentina

PostPosted: Fri Oct 17, 2008 3:57 pm
by Neosoft Support
I'm not sure if it's possible, but I will definitely add it to the list.

PostPosted: Sun Feb 22, 2009 4:28 pm
by David de Argentina
Hi Dave,

I found this stuff. I think could be usefull
In PowerBasic, the single quote is used as comment like the dot in Neobook

' ****************************************************************************************
' IDocHostUIHandler interface
' IID = ("bd3f23c0-d43e-11cf-893b-00aa00bdce1a")
' Minimum avaiability: Internet Explorer 4.0
' ****************************************************************************************

$IID_IDocHostUIHandler = GUID$("{bd3f23c0-d43e-11cf-893b-00aa00bdce1a}")

' ****************************************************************************************
' This custom interface enables an application hosting the WebBrowser Control or automating
' Microsoft Internet Explorer to replace the menus, toolbars, and context menus used by
' MSHTML.
' Remarks
' On initialization, MSHTML calls QueryInterface on the host's client site, requesting an
' IDocHostUIHandler interface. If available, MSHTML will call IDocHostUIHandler methods at
' appropriate times during the lifetime of the MSHTML component.
' Implementing this interface enables MSHTML to communicate with the host about its user
' interface status. The host can use this interface to modify such internal user interface
' elements as menus, context menus, and toolbars.

' ****************************************************************************************
' enum DOCHOSTUITYPE
' ****************************************************************************************
%DOCHOSTUITYPE_BROWSE = 0
%DOCHOSTUITYPE_AUTHOR = 1

' ****************************************************************************************
' enum DOCHOSTUIDBLCLK
' ****************************************************************************************
%DOCHOSTUIDBLCLK_DEFAULT = 0
%DOCHOSTUIDBLCLK_SHOWPROPERTIES = 1
%DOCHOSTUIDBLCLK_SHOWCODE = 2

' ****************************************************************************************
' enum DOCHOSTUIFLAG
' ****************************************************************************************
%DOCHOSTUIFLAG_DIALOG = &H1
%DOCHOSTUIFLAG_DISABLE_HELP_MENU = &H2
%DOCHOSTUIFLAG_NO3DBORDER = &H4
%DOCHOSTUIFLAG_SCROLL_NO = &H8
%DOCHOSTUIFLAG_DISABLE_SCRIPT_INACTIVE = &H10
%DOCHOSTUIFLAG_OPENNEWWIN = &H20
%DOCHOSTUIFLAG_DISABLE_OFFSCREEN = &H40
%DOCHOSTUIFLAG_FLAT_SCROLLBAR = &H80
%DOCHOSTUIFLAG_DIV_BLOCKDEFAULT = &H100
%DOCHOSTUIFLAG_ACTIVATE_CLIENTHIT_ONLY = &H200
%DOCHOSTUIFLAG_OVERRIDEBEHAVIORFACTORY = &H400
%DOCHOSTUIFLAG_CODEPAGELINKEDFONTS = &H800
%DOCHOSTUIFLAG_URL_ENCODING_DISABLE_UTF8 = &H1000
%DOCHOSTUIFLAG_URL_ENCODING_ENABLE_UTF8 = &H2000
%DOCHOSTUIFLAG_ENABLE_FORMS_AUTOCOMPLETE = &H4000
%DOCHOSTUIFLAG_ENABLE_INPLACE_NAVIGATION = &H10000
%DOCHOSTUIFLAG_IME_ENABLE_RECONVERSION = &H20000
%DOCHOSTUIFLAG_THEME = &H40000
%DOCHOSTUIFLAG_NOTHEME = &H80000
%DOCHOSTUIFLAG_NOPICS = &H100000
%DOCHOSTUIFLAG_NO3DOUTERBORDER = &H200000
%DOCHOSTUIFLAG_DISABLE_EDIT_NS_FIXUP = &H400000
%DOCHOSTUIFLAG_LOCAL_MACHINE_ACCESS_CHECK = &H800000
%DOCHOSTUIFLAG_DISABLE_UNTRUSTEDPROTOCOL = &H1000000

' ****************************************************************************************
' DOCHOSTUIINFO Structure
' Used by the IDocHostUIHandler::GetHostInfo method to allow MSHTML to retrieve information
' about the host's UI requirements.
' ****************************************************************************************
' Members
' cbSize
' ULONG containing the size of this structure, in bytes.
' dwFlags
' One or more of the DOCHOSTUIFLAG values that specify the UI capabilities of the host.
' dwDoubleClick
' One of the DOCHOSTUIDBLCLK values that specify the operation that should take
' place in response to a double-click.
' pchHostCss
' Pointer to a set of Cascading Style Sheets (CSS) rules sent down by the host.
' These CSS rules affect the page containing them.
' pchHostNS
' Pointer to a semicolon-delimited namespace list. This list allows the host to
' supply a namespace declaration for custom tags on the page.
' ****************************************************************************************

TYPE DOCHOSTUIINFO
cbSize AS DWORD
dwFlags AS DWORD
dwDoubleClick AS DWORD
pchHostCss AS STRING PTR
pchHostNS AS STRING PTR
END TYPE
' ****************************************************************************************

' ****************************************************************************************
' IDocHostUIHandler virtual table
' ****************************************************************************************
TYPE IDocHostUIHandlerVTbl
pQueryInterface AS DWORD
pAddRef AS DWORD
pRelease AS DWORD
pShowContextMenu AS DWORD
pGetHostInfo AS DWORD
pShowUI AS DWORD
pHideUI AS DWORD
pUpdateUI AS DWORD
pEnableModeless AS DWORD
pOnDocWindowActivate AS DWORD
pOnFrameWindowActivate AS DWORD
pResizeBorder AS DWORD
pTranslateAccelerator AS DWORD
pGetOptionKeyPath AS DWORD
pGetDropTarget AS DWORD
pGetExternal AS DWORD
pTranslateUrl AS DWORD
pFilterDataObject AS DWORD
END TYPE
' ***********************************************

FUNCTION IDocHostUIHandler_ShowContextMenu (BYVAL pthis AS DWORD PTR, BYVAL dwID AS DWORD, BYVAL ppt AS DWORD PTR, BYVAL pcmdtReserved AS DWORD PTR, BYVAL pdispReserved AS DWORD PTR) AS LONG

' This event notifies that the user has clicked the right mouse button to show the
' context menu. We can anulate it returning %S_OK and show our context menu.

' Don not allow to show the context menu
' MSGBOX "Sorry! Context menu disabled"
'FUNCTION = %S_OK

FUNCTION = %S_FALSE

END FUNCTION


My devaluated cent,
David de Argentina