Home COM GDI+ WebBrowser Data Access

IHTMLEditDesigner Interface

 

IID_IHHTMLEditDesigner

{3050F662-98B5-11CF-BB82-00AA00BDCE0B}

 

 

This custom interface provides methods that enable clients using the editor to intercept Microsoft Internet Explorer events so that they can change the editor's default behavior.

 

Documentation: IHTMLEditDesigner Interface

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

IHHTMLEditDesigner Methods

Description

PreHandleEvent

Called by MSHTML before the MSHTML Editor processes an event, so that the designer can provide its own event handling behavior.

PostHandleEvents

Called by MSHTML after the MSHTML Editor has processed an event, so that the designer can provide its own event handling behavior.

TranslateAccelerator

Called by MSHTML to translate a key combination entered by a user into an appropriate command.

PostEditorEventNotify

Called by MSHTML after an event has been handled by the MSHTML Editor and any registered edit designers.

 

ITMLEditDesigner interface implementation

 


$IID_IHTMLEditDesigner = GUID$("{3050F662-98B5-11CF-BB82-00AA00BDCE0B}")

' ****************************************************************************************
' IHTMLEditDesigner interface virtual table
' ****************************************************************************************
TYPE IHTMLEditDesignerVtbl
   ' IUnknown methods
   pQueryInterface         AS DWORD          ' // QueryInterface method
   pAddRef                 AS DWORD          ' // AddRef method
   pRelease                AS DWORD          ' // Release method
   ' IHTMLEditDesigner methods
   pPreHandleEvent         AS DWORD          ' // PreHandleEvent method
   pPostHandleEvents       AS DWORD          ' // PostHandleEvents method
   pTranslateAccelerator   AS DWORD          ' // TranslateAccelerator method
   pPostEditorEventNotify  AS DWORD          ' // PostEditorEventNotify method
   ' Custom data
   pVtblAddr               AS DWORD          ' // Address of the virtual table
   cRef                    AS DWORD          ' // Reference count
END TYPE
' ****************************************************************************************

' ****************************************************************************************
' Builds the IHTMLEditDesigner Virtual Table
' Returns a cookie that is a pointer to a IHTMLEditDesignerVtbl structure.
' ****************************************************************************************
FUNCTION IHTMLEditDesigner_BuildVtbl () AS DWORD

   LOCAL pVtbl AS IHTMLEditDesignerVtbl PTR
   LOCAL pUnk AS IHTMLEditDesignerVtbl PTR

   pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
   IF pVtbl = 0 THEN EXIT FUNCTION

   @pVtbl.pQueryInterface         = CODEPTR(IHTMLEditDesigner_QueryInterface)
   @pVtbl.pAddRef                 = CODEPTR(IHTMLEditDesigner_AddRef)
   @pVtbl.pRelease                = CODEPTR(IHTMLEditDesigner_Release)

   @pVtbl.pPreHandleEvent         = CODEPTR(IHTMLEditDesigner_PreHandleEvent)
   @pVtbl.pPostHandleEvents       = CODEPTR(IHTMLEditDesigner_PostHandleEvents)
   @pVtbl.pTranslateAccelerator   = CODEPTR(IHTMLEditDesigner_TranslateAccelerator)
   @pVtbl.pPostEditorEventNotify  = CODEPTR(IHTMLEditDesigner_PostEditorEventNotify)

   @pVtbl.pVtblAddr               = pVtbl
   @pVtbl.cRef                    = 1

   pUnk = VARPTR(@pVtbl.pVtblAddr)
   FUNCTION = pUnk

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' IHTMLEditDesigner_QueryInterface method
' Returns the IUnknown of our class and increments the reference counter.
' ****************************************************************************************
FUNCTION IHTMLEditDesigner_QueryInterface (BYVAL pCookie AS IHTMLEditDesignerVtbl PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
   IF riid = $IID_IHTMLEditDesigner THEN
      ppvObj = pCookie
      INCR @@pCookie.cRef
      FUNCTION = %S_OK
   ELSE
      FUNCTION = %E_NOINTERFACE
   END IF
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' IHTMLEditDesigner_IUnknown_AddRef method
' Increments the reference counter.
' ****************************************************************************************
FUNCTION IHTMLEditDesigner_AddRef (BYVAL pCookie AS IHTMLEditDesignerVtbl PTR) AS DWORD
   INCR @@pCookie.cRef
   FUNCTION = @@pCookie.cRef
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' IHTMLEditDesigner_IUnknown_Release method
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION IHTMLEditDesigner_Release (BYVAL pCookie AS IHTMLEditDesignerVtbl 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 before the MSHTML Editor processes an event, so that the designer can
' provide its own event handling behavior.
' ****************************************************************************************
FUNCTION IHTMLEditDesigner_PreHandleEvent ( _
  BYVAL pCookie AS IHTMLEditDesignerVtbl PTR _
, BYVAL inEventDispId AS LONG _
, BYVAL pIEventObj AS DWORD _
) AS LONG

  ' Put your code here
  ' FUNCTION = %S_OK or %S_FALSE

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Called by MSHTML after the MSHTML Editor has processed an event, so that the designer
' can provide its own event handling behavior.
' ****************************************************************************************
FUNCTION IHTMLEditDesigner_PostHandleEvents ( _
  BYVAL pCookie AS IHTMLEditDesignerVtbl PTR _
, BYVAL inEventDispId AS LONG _
, BYREF pIEventObj AS DWORD _
) AS LONG

  ' Put your code here
  ' FUNCTION = %S_OK or %S_FALSE

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Called by MSHTML to translate a key combination entered by a user into an appropriate command.
' ****************************************************************************************
FUNCTION IHTMLEditDesigner_TranslateAccelerator ( _
  BYVAL pCookie AS IHTMLEditDesignerVtbl PTR _
, BYVAL inEventDispId AS LONG _
, BYREF pIEventObj AS DWORD _
) AS LONG

  ' Put your code here
  ' FUNCTION = %S_OK or %S_FALSE

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Called by MSHTML after an event has been handled by the MSHTML Editor and any registered
' edit designers.
' ****************************************************************************************
FUNCTION IHTMLEditDesigner_PostEditorEventNotify ( _
  BYVAL pCookie AS IHTMLEditDesignerVtbl PTR _
, BYVAL inEventDispId AS LONG _
, BYREF pIEventObj AS DWORD _
) AS LONG

  ' Put your code here
  ' FUNCTION = %S_OK or %S_FALSE

END FUNCTION
' ****************************************************************************************
 

 

Page last updated on Monday, 03 April 2006 19:56:13 +0200