|
|
|
IHTMLPainterEventInfo Interface |
|
IID_IHTMLPainterEventInfo |
{3050F6DF-98B5-11CF-BB82-00AA00BDCE0B} |
|
This custom interface provides methods to MSHTML so that a rendering behavior can provide certain special event handling.
|
|
Methods in VTable order |
|
|
IUnknown Methods |
Description |
|
QueryInterface |
Returns pointers to supported interfaces. |
|
AddRef |
Increments reference count. |
|
Release |
Decrements reference count. |
|
IHTMLPainterEventInfo Methods |
Description |
|
GetEventInfoFlags |
Called by MSHTML to determine whether the IHTMLPainterEventInfo::GetEventTarget and IHTMLPainterEventInfo::SetCursor methods of this interface are to be called in response to successful hit-tests on the element to which the rendering behavior is attached. |
|
GetEventTarget |
Called by MSHTML after a successful hit-test on a rendering behavior to transfer event handling to another element. |
|
SetCursor |
Called by MSHTML during mouseover events on the element to which the behavior is attached to enable the behavior to change the insertion point icon. |
|
StringFromPartID |
Called by MSHTML during a call to IHTMLElement2::componentFromPoint so that a behavior can specify a name for the component. |
|
ITMLPainterEventInfo interface implementation |
$IID_IHTMLPainterEventInfo = GUID$("{3050F6DF-98B5-11CF-BB82-00AA00BDCE0B}")
' ****************************************************************************************
' IHTMLPainterEventInfo interface virtual table
' ****************************************************************************************
TYPE IHTMLPainterEventInfoVtbl
' IUnknown methods
pQueryInterface AS DWORD ' // QueryInterface method
pAddRef AS DWORD ' // AddRef method
pRelease AS DWORD ' // Release method
' IHTMLPainterEventInfo method
pGetEventInfoFlags AS DWORD ' // GetEventInfoFlags method
pGetEventTarget AS DWORD ' // GetEventTarget method
pSetCursor AS DWORD ' // SetCursor method
pStringFromPartID AS DWORD ' // StringFromPartID method
' Custom data
pVtblAddr AS DWORD ' // Address of the virtual table
cRef AS DWORD ' // Reference count
END TYPE
' ****************************************************************************************
' ****************************************************************************************
' Builds the IHTMLPainterEventInfo Virtual Table
' Returns a cookie that is a pointer to a IHTMLPainterEventInfoVtbl structure.
' ****************************************************************************************
FUNCTION IHTMLPainterEventInfo_BuildVtbl () AS DWORD
LOCAL pVtbl AS IHTMLPainterEventInfoVtbl PTR
LOCAL pUnk AS IHTMLPainterEventInfoVtbl PTR
pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
IF pVtbl = 0 THEN EXIT FUNCTION
@pVtbl.pQueryInterface = CODEPTR(IHTMLPainterEventInfo_QueryInterface)
@pVtbl.pAddRef = CODEPTR(IHTMLPainterEventInfo_AddRef)
@pVtbl.pRelease = CODEPTR(IHTMLPainterEventInfo_Release)
@pVtbl.pGetEventInfoFlags = CODEPTR(IHTMLPainterEventInfo_GetEventInfoFlags)
@pVtbl.pGetEventTarget = CODEPTR(IHTMLPainterEventInfo_GetEventTarget)
@pVtbl.pSetCursor = CODEPTR(IHTMLPainterEventInfo_SetCursor)
@pVtbl.pStringFromPartID = CODEPTR(IHTMLPainterEventInfo_StringFromPartID)
@pVtbl.pVtblAddr = pVtbl
@pVtbl.cRef = 1
pUnk = VARPTR(@pVtbl.pVtblAddr)
FUNCTION = pUnk
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IHTMLPainterEventInfo_QueryInterface method
' Returns the IUnknown of our class and increments the reference counter.
' ****************************************************************************************
FUNCTION IHTMLPainterEventInfo_QueryInterface (BYVAL pCookie AS IHTMLPainterEventInfoVtbl PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
IF riid = $IID_IHTMLPainterEventInfo THEN
ppvObj = pCookie
INCR @@pCookie.cRef
FUNCTION = %S_OK
ELSE
FUNCTION = %E_NOINTERFACE
END IF
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IHTMLPainterEventInfo_IUnknown_AddRef method
' Increments the reference counter.
' ****************************************************************************************
FUNCTION IHTMLPainterEventInfo_AddRef (BYVAL pCookie AS IHTMLPainterEventInfoVtbl PTR) AS DWORD
INCR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IHTMLPainterEventInfo_IUnknown_Release method
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION IHTMLPainterEventInfo_Release (BYVAL pCookie AS IHTMLPainterEventInfoVtbl PTR) AS DWORD
DECR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
IF @@pCookie.cRef = 0 THEN
IF ISTRUE @@pCookie.pVtblAddr THEN
HeapFree(GetProcessHeap(), 0, BYVAL @@pCookie.pVtblAddr)
END IF
END IF
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Called by MSHTML to determine whether the IHTMLPainterEventInfo::GetEventTarget and
' IHTMLPainterEventInfo::SetCursor methods of this interface are to be called in response
' to successful hit-tests on the element to which the rendering behavior is attached.
' ****************************************************************************************
FUNCTION IHTMLPainterEventInfo_GetEventInfoFlags ( _
BYVAL pCookie AS IHTMLPainterEventInfoVtbl PTR _
, BYREF plEventInfoFlags AS DWORD _
) AS LONG
' Put your code here
' FUNCTION = %S_OK or an error value
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Called by MSHTML after a successful hit-test on a rendering behavior to transfer event
' handling to another element.
' ****************************************************************************************
FUNCTION IHTMLPainterEventInfo_GetEventTarget ( _
BYVAL pCookie AS IHTMLPainterEventInfoVtbl PTR _
, BYREF pplELement AS DWORD _
) AS LONG
' Put your code here
' FUNCTION = %S_OK or an error value
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Called by MSHTML during mouseover events on the element to which the behavior is
' attached to enable the behavior to change the insertion point icon.
' ****************************************************************************************
FUNCTION IHTMLPainterEventInfo_SetCursor ( _
BYVAL pCookie AS IHTMLPainterEventInfoVtbl PTR _
, BYVAL lPartID AS LONG _
) AS LONG
' Put your code here
' FUNCTION = %S_OK or an error value
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Called by MSHTML during a call to IHTMLElement2::componentFromPoint so that a behavior
' can specify a name for the component.
' ****************************************************************************************
FUNCTION IHTMLPainterEventInfo_StringFromPartID ( _
BYVAL pCookie AS IHTMLPainterEventInfoVtbl PTR _
, BYVAL lPartID AS LONG _
, BYREF pbstrPart AS STRING _
) AS LONG
' Put your code here
' FUNCTION = %S_OK or an error value
END FUNCTION
' ****************************************************************************************
|
Page last updated on Monday, 03 April 2006 19:58:09 +0200