Home COM GDI+ WebBrowser Data Access

ISimpleFrameSite Interface

 

IID_ISimpleFrameSite

{742B0E01-14E6-101B-914E-00AA00300CAB}

 

 

The ISimpleFrameSite interface supports simple frame controls that act as simple containers for other nested controls. Some controls merely contain other controls. In such cases, the simple control container, called a simple frame, doesn't have to implement all container requirements. It can delegate most of the interface calls from its contained controls to the outer container that manages the simple frame. To support what are called simple frame controls, a container implements this interface as well as other site interfaces such as IOleControlSite.

 

An example of a simple frame control is a group box that only needs to capture a few keystrokes for its contained controls to implement the correct tab or arrow key behavior, but does not want to handle every other message. Through the two methods of this interface, the simple frame control passes messages to its control site both before and after its own processing. If that site is itself a simple frame, it can continue to pass messages up the chain.

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

ISimpleFrameSite Methods

Description

PreMessageFilter

Sends the simple frame site a message that is received by a control's own window before the control itself does any processing.

PostMessageFilter

Sends the simple frame site a message that is received by a control's own window after the control does its own processing.

 

PreMessageFilter

 

FUNCTION ISimpleFrameSite_PreMessageFilter ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL hWnd AS DWORD _

, BYVAL msg AS DWORD _

, BYVAL wp AS DWORD _

, BYVAL lp AS LONG _

, BYREF plResult AS LONG _

, BYREF pdwCookie AS DWORD _

  ) AS LONG
 

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[3] USING ISimpleFrameSite_PreMessageFilter (pthis, hWnd, msg, wp, lp, plResult, pdwCookie) TO HRESULT
  FUNCTION = HRESULT


END FUNCTION

 

 

PostMessageFilter

 

FUNCTION ISimpleFrameSite_PostMessageFilter ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL hWnd AS DWORD _

, BYVAL msg AS DWORD _

, BYVAL wp AS DWORD _

, BYVAL lp AS LONG _

, BYREF plResult AS LONG _

, BYVAL pdwCookie AS DWORD _

  ) AS LONG
 

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[4] USING ISimpleFrameSite_PostMessageFilter (pthis, hWnd, msg, wp, lp, plResult, pdwCookie) TO HRESULT
  FUNCTION = HRESULT


END FUNCTION

 

 

ISimpleFrameSite interface implementation

 


$IID_ISimpleFrameSite = GUID$("{742B0E01-14E6-101B-914E-00AA00300CAB}")

' ****************************************************************************************
' ISimpleFrameSite interface
' ****************************************************************************************
TYPE ISimpleFrameSiteVtbl
   ' IUnknown methods
   pQueryInterface         AS DWORD          ' // QueryInterface method
   pAddRef                 AS DWORD          ' // AddRef method
   pRelease                AS DWORD          ' // Release method
   ' ISimpleFrameSite members
   pPreMessageFilter       AS DWORD          ' // PreMessageFilter method
   pPostMessageFilter      AS DWORD          ' // PostMessageFilter method
   ' Custom data
   pVtblAddr               AS DWORD          ' // Address of the virtual table
   cRef                    AS DWORD          ' // Reference count
END TYPE
' ****************************************************************************************

' ****************************************************************************************
' Builds the ISimpleFrameSite Virtual Table
' Returns a cookie that is a pointer to a ISimpleFrameSiteVtbl structure.
' ****************************************************************************************
FUNCTION ISimpleFrameSite_BuildVtbl () AS DWORD

   LOCAL pVtbl AS ISimpleFrameSiteVtbl PTR
   LOCAL pUnk AS ISimpleFrameSiteVtbl PTR

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

   @pVtbl.pQueryInterface         = CODEPTR(ISimpleFrameSite_QueryInterface)
   @pVtbl.pAddRef                 = CODEPTR(ISimpleFrameSite_AddRef)
   @pVtbl.pRelease                = CODEPTR(ISimpleFrameSite_Release)

   @pVtbl.pPreMessageFilter       = CODEPTR(ISimpleFrameSite_PreMessageFilter)
   @pVtbl.pPostMessageFilter      = CODEPTR(ISimpleFrameSite_PostMessageFilter)

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

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

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

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

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

' ****************************************************************************************
' ISimpleFrameSite_Release method
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION ISimpleFrameSite_Release (BYVAL pCookie AS ISimpleFrameSiteVtbl 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
' ****************************************************************************************

' ****************************************************************************************
' Sends the simple frame site a message that is received by a control's own window before
' the control itself does any processing.
' ****************************************************************************************
FUNCTION ISimpleFrameSite_PreMessageFilter (BYVAL pCookie AS ISimpleFrameSiteVtbl PTR, BYVAL hWnd AS DWORD, BYVAL msg AS DWORD, BYVAL wp AS DWORD, BYVAL lp AS LONG, BYREF plResult AS LONG, BYREF pdwCookie AS DWORD) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Sends the simple frame site a message that is received by a control's own window after
' the control does its own processing.
' ****************************************************************************************
FUNCTION ISimpleFrameSite_PostMessageFilter (BYVAL pCookie AS ISimpleFrameSiteVtbl PTR, BYVAL hWnd AS DWORD, BYVAL msg AS DWORD, BYVAL wp AS DWORD, BYVAL lp AS LONG, BYREF plResult AS LONG, BYVAL pdwCookie AS DWORD) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************
 

 

Page last updated on Monday, 03 April 2006 20:27:40 +0200