|
|
|
IHTMLPainterOverlay Interface |
|
IID_IHTMLPainterOverlay |
{3050F7E3-98B5-11CF-BB82-00AA00BDCE0B} |
|
This custom interface provides a method to MSHTML that enables a rendering behavior to use the Microsoft DirectDraw hardware overlay buffer, if the buffer is present.
|
|
Methods in VTable order |
|
|
IUnknown Methods |
Description |
|
QueryInterface |
Returns pointers to supported interfaces. |
|
AddRef |
Increments reference count. |
|
Release |
Decrements reference count. |
|
IHTMLPainterOverlay Method |
Description |
|
OnMove |
Called by MSHTML when the element to which a rendering behavior is attached is repositioned or resized on the screen. |
|
ITMLPainterOverlay interface implementation |
$IID_IHTMLPainterOverlay = GUID$("{3050F7E3-98B5-11CF-BB82-00AA00BDCE0B}")
' ****************************************************************************************
' IHTMLPainterOverlay interface virtual table
' ****************************************************************************************
TYPE IHTMLPainterOverlayVtbl
' IUnknown methods
pQueryInterface AS DWORD ' // QueryInterface method
pAddRef AS DWORD ' // AddRef method
pRelease AS DWORD ' // Release method
' IHTMLPainterOverlay method
pOnMove AS DWORD ' // OnMove method
' Custom data
pVtblAddr AS DWORD ' // Address of the virtual table
cRef AS DWORD ' // Reference count
END TYPE
' ****************************************************************************************
' ****************************************************************************************
' Builds the IHTMLPainterOverlay Virtual Table
' Returns a cookie that is a pointer to a IHTMLPainterOverlayVtbl structure.
' ****************************************************************************************
FUNCTION IHTMLPainterOverlay_BuildVtbl () AS DWORD
LOCAL pVtbl AS IHTMLPainterOverlayVtbl PTR
LOCAL pUnk AS IHTMLPainterOverlayVtbl PTR
pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
IF pVtbl = 0 THEN EXIT FUNCTION
@pVtbl.pQueryInterface = CODEPTR(IHTMLPainterOverlay_QueryInterface)
@pVtbl.pAddRef = CODEPTR(IHTMLPainterOverlay_AddRef)
@pVtbl.pRelease = CODEPTR(IHTMLPainterOverlay_Release)
@pVtbl.pOnMove = CODEPTR(IHTMLPainterOverlay_OnMove)
@pVtbl.pVtblAddr = pVtbl
@pVtbl.cRef = 1
pUnk = VARPTR(@pVtbl.pVtblAddr)
FUNCTION = pUnk
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IHTMLPainterOverlay_QueryInterface method
' Returns the IUnknown of our class and increments the reference counter.
' ****************************************************************************************
FUNCTION IHTMLPainterOverlay_QueryInterface (BYVAL pCookie AS IHTMLPainterOverlayVtbl PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
IF riid = $IID_IHTMLPainterOverlay THEN
ppvObj = pCookie
INCR @@pCookie.cRef
FUNCTION = %S_OK
ELSE
FUNCTION = %E_NOINTERFACE
END IF
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IHTMLPainterOverlay_IUnknown_AddRef method
' Increments the reference counter.
' ****************************************************************************************
FUNCTION IHTMLPainterOverlay_AddRef (BYVAL pCookie AS IHTMLPainterOverlayVtbl PTR) AS DWORD
INCR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IHTMLPainterOverlay_IUnknown_Release method
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION IHTMLPainterOverlay_Release (BYVAL pCookie AS IHTMLPainterOverlayVtbl 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 when the element to which a rendering behavior is attached is
' repositioned or resized on the screen.
' ****************************************************************************************
FUNCTION IHTMLPainterOverlay_OnMove ( _
BYVAL pCookie AS IHTMLPainterOverlayVtbl PTR _
, BYREF rcDevice AS RECT _
) 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:21 +0200