Home COM GDI+ WebBrowser Data Access

IOleInPlaceObjectWindowless Interface

 

IID_IOleInPlaceObjectWindoless

{1C2056CC-5EF4-101B-8BC8-00AA003E3B29}

 

 

The IOleInPlaceObjectWindowless interface enables a windowless object to process window messages and participate in drag and drop operations. It is derived from and extends the IOleInPlaceObject interface.

 

A small object, such as a control, does not need a window of its own. Instead, it can rely on its container to dispatch window messages and help the object to participate in drag and drop operations. The container must implement the IOleInPlaceSiteWindowless interface. Otherwise, the object must act as a normal compound document object and create a window when it is activated.

 

A container calls the methods in this interface to dispatch window messages to an in-place-active windowless object and to assist the object in participating in drag and drop operations. The container must implement a site object with the IOleInPlaceSiteWindowless interface to support these activities. See the IOleInPlaceSiteWindowless interface for more information on operations involving windowless objects, such as drawing, drag and drop, and processing window messages.

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

IOleWindow Methods

Description

GetWindow

Gets a window handle.

ContextSensitiveHelp

Controls enabling of context-sensitive help.

IOleInPlaceObject Methods

Description

InPlaceDeactivate

Deactivate active in-place object.

UIDeactivate

Deactivate and remove UI of active object.

SetObjectRects

Portion of in-place object to be visible.

ReactivateAndUndo

Reactivate previously deactivated object.

IOleInPlaceObjectWindoless Methods

Description

OnWindowMessage

Dispatches a message from the container to a windowless object.

GetDropTarget

Supplies the IDropTarget interface for a windowless object that supports drag and drop.

 

OnWindowMessage

 

FUNCTION IOleInPlaceObjectWindowless_OnWindowMessage ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL msg AS DWORD _

, BYVAL wParam AS DWORD _

, BYVAL lParam AS DWORD _

, BYREF plResult AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[9] USING IOleInPlaceObjectWindowless_OnWindowMessage (pthis, msg, wParam, lParam, plResult) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetDropTarget

 

FUNCTION IOleInPlaceObjectWindowless_GetDropTarget ( _

  BYVAL pthis AS DWORD PTR _

, BYREF ppDropTarget AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[10] USING IOleInPlaceObjectWindowless_GetDropTarget (pthis, ppDropTarget) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

IOleInPlaceObjectWindowless interface implementation

 


$IID_IOleInPlaceObjectWindowless = GUID$("{1C2056CC-5EF4-101B-8BC8-00AA003E3B29}")

' ****************************************************************************************
' IOleInPlaceObjectWindowless interface
' ****************************************************************************************
TYPE IOleInPlaceObjectWindowlessVtbl
   ' IUnknown methods
   pQueryInterface          AS DWORD          ' // QueryInterface method
   pAddRef                  AS DWORD          ' // AddRef method
   pRelease                 AS DWORD          ' // Release method
   ' IOleWindow  members
   pGetWindow               AS DWORD          ' // GetWindow method
   pContextSensitiveHelp    AS DWORD          ' // GetWindow method
   ' IOleInPlaceObject members
   pInPlaceDeactivate       AS DWORD          ' // InPlaceDeactivate method
   pUIDeactivate            AS DWORD          ' // UIDeactivate method
   pSetObjectRects          AS DWORD          ' // SetObjectRects method
   pReactivateAndUndo       AS DWORD          ' // ReactivateAndUndo method
   ' IOleInPlaceObjectWindowless members
   pOnWindowMessage         AS DWORD          ' // OnWindowMessage method
   pGetDropTarget           AS DWORD          ' // GetDropTarget method
   ' Custom data
   pVtblAddr                AS DWORD          ' // Address of the virtual table
   cRef                     AS DWORD          ' // Reference count
END TYPE
' ****************************************************************************************

' ****************************************************************************************
' Builds the IOleInPlaceObjectWindowless Virtual Table
' Returns a cookie that is a pointer to a IOleInPlaceObjectWindowlessVtbl structure.
' ****************************************************************************************
FUNCTION IOleInPlaceObjectWindowless_BuildVtbl () AS DWORD

   LOCAL pVtbl AS IOleInPlaceObjectWindowlessVtbl PTR
   LOCAL pUnk AS IOleInPlaceObjectWindowlessVtbl PTR

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

   @pVtbl.pQueryInterface          = CODEPTR(IOleInPlaceObjectWindowless_QueryInterface)
   @pVtbl.pAddRef                  = CODEPTR(IOleInPlaceObjectWindowless_AddRef)
   @pVtbl.pRelease                 = CODEPTR(IOleInPlaceObjectWindowless_Release)

   @pVtbl.pGetWindow               = CODEPTR(IOleInPlaceObjectWindowless_GetWindow)
   @pVtbl.pContextSensitiveHelp    = CODEPTR(IOleInPlaceObjectWindowless_ContextSensitiveHelp)
   @pVtbl.pInPlaceDeactivate       = CODEPTR(IOleInPlaceObjectWindowless_InPlaceDeactivate)
   @pVtbl.pUIDeactivate            = CODEPTR(IOleInPlaceObjectWindowless_UIDeactivate)
   @pVtbl.pSetObjectRects          = CODEPTR(IOleInPlaceObjectWindowless_SetObjectRects)
   @pVtbl.pReactivateAndUndo       = CODEPTR(IOleInPlaceObjectWindowless_ReactivateAndUndo)
   @pVtbl.pOnWindowMessage         = CODEPTR(IOleInPlaceObjectWindowless_OnWindowMessage)
   @pVtbl.pGetDropTarget           = CODEPTR(IOleInPlaceObjectWindowless_GetDropTarget)

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

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

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

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

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

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

' ****************************************************************************************
' Gets a window handle.
' ****************************************************************************************
FUNCTION IOleInPlaceObjectWindowless_GetWindow (BYVAL pCookie AS IOleInPlaceObjectWindowlessVtbl PTR, BYREF phwnd AS DWORD) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Controls enabling of context-sensitive help.
' ****************************************************************************************
FUNCTION IOleInPlaceObjectWindowless_ContextSensitiveHelp (BYVAL pCookie AS IOleInPlaceObjectWindowlessVtbl PTR, BYVAL fEnterMode AS LONG) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Deactivate active in-place object.
' ****************************************************************************************
FUNCTION IOleInPlaceObjectWindowless_InPlaceDeactivate (BYVAL pCookie AS IOleInPlaceObjectWindowlessVtbl PTR) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Deactivate and remove UI of active object.
' ****************************************************************************************
FUNCTION IOleInPlaceObjectWindowless_UIDeactivate (BYVAL pCookie AS IOleInPlaceObjectWindowlessVtbl PTR) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Portion of in-place object to be visible.
' ****************************************************************************************
FUNCTION IOleInPlaceObjectWindowless_SetObjectRects (BYVAL pCookie AS IOleInPlaceObjectWindowlessVtbl PTR, BYREF lprcPosRect AS RECT, BYREF lprcClipRect AS RECT) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Reactivate previously deactivated object.
' ****************************************************************************************
FUNCTION IOleInPlaceObjectWindowless_ReactivateAndUndo (BYVAL pCookie AS IOleInPlaceObjectWindowlessVtbl PTR) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Dispatches a message from the container to a windowless object.
' ****************************************************************************************
FUNCTION IOleInPlaceObjectWindowless_OnWindowMessage (BYVAL pCookie AS IOleInPlaceObjectWindowlessVtbl PTR, BYVAL msg AS DWORD, BYVAL wParam AS DWORD, BYVAL lParam AS DWORD, BYREF plResult AS DWORD) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Supplies the IDropTarget interface for a windowless object that supports drag and drop.
' ****************************************************************************************
FUNCTION IOleInPlaceObjectWindowless_GetDropTarget (BYVAL pCookie AS IOleInPlaceObjectWindowlessVtbl PTR, BYREF ppDropTarget AS DWORD) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************
 

 

Page last updated on Monday, 03 April 2006 20:32:10 +0200