|
|
|
IOleInPlaceUIWindow Interface |
|
IID_IOleInPlaceUIWindow |
{00000115-0000-0000-C000-000000000046} |
|
The IOleInPlaceUIWindow interface is implemented by container applications and used by object applications to negotiate border space on the document or frame window. The container provides a RECT structure in which the object can place toolbars and other similar controls, determines if tools can in fact be installed around the object's window frame, allocates space for the border, and establishes a communication channel between the object and each frame and document window.
The document window may not exist in all applications. When this is the case, IOleInPlaceSite::GetWindowContext returns NULL for IOleInPlaceUIWindow.
Used by object applications to negotiate border space on the document or frame window when one of its objects is being activated, or to renegotiate border space if the size of the object changes.
|
|
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. |
|
IOleInPlaceUIWindow Methods |
Description |
|
GetBorder |
Specifies a RECT structure for toolbars and controls. |
|
RequestBorderSpace |
Determines if tools can be installed around object's window frame. |
|
SetBorderSpace |
Allocates space for the border. |
|
SetActiveObject |
Provides for direct communication between the object and each document and frame window. |
|
GetBorder |
|
FUNCTION IOleInPlaceUIWindow_GetBorder ( _ BYVAL pthis AS DWORD PTR _ , BYREF lprectBorder AS RECT _
) AS
LONG
|
|
RequestBorderSpace |
|
FUNCTION IOleInPlaceUIWindow_RequestBorderSpace ( _ BYVAL pthis AS DWORD PTR _ , BYREF pborderwidths AS RECT _
) AS
DWORD
|
|
SetBorderSpace |
|
FUNCTION IOleInPlaceUIWindow_SetBorderSpace ( _ BYVAL pthis AS DWORD PTR _ , BYREF pborderwidths AS RECT _
) AS
LONG
|
|
SetActiveObject |
|
FUNCTION IOleInPlaceUIWindow_SetActiveObject ( _ BYVAL pthis AS DWORD PTR _ , BYVAL pActiveObject AS DWORD _ , BYVAL strObjName AS STRING _
)
AS LONG
strObjName =
UCODE$(strObjName)
& $NUL
|
|
IOleInPlaceUIWindow interface implementation |
$IID_IOleInPlaceUIWindow = GUID$("{00000115-0000-0000-C000-000000000046}")
' ****************************************************************************************
' IOleInPlaceUIWindow interface
' ****************************************************************************************
TYPE IOleInPlaceUIWindowVtbl
' 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
' IOleInPlaceUIWindow members
pGetBorder AS DWORD ' // GetBorder method
pRequestBorderSpace AS DWORD ' // RequestBorderSpace method
pSetBorderSpace AS DWORD ' // SetBorderSpace method
pSetActiveObject AS DWORD ' // SetActiveObject method
' Custom data
pVtblAddr AS DWORD ' // Address of the virtual table
cRef AS DWORD ' // Reference count
END TYPE
' ****************************************************************************************
' ****************************************************************************************
' Builds the IOleInPlaceUIWindow Virtual Table
' Returns a cookie that is a pointer to a IOleInPlaceUIWindowVtbl structure.
' ****************************************************************************************
FUNCTION IOleInPlaceUIWindow_BuildVtbl () AS DWORD
LOCAL pVtbl AS IOleInPlaceUIWindowVtbl PTR
LOCAL pUnk AS IOleInPlaceUIWindowVtbl PTR
pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
IF pVtbl = 0 THEN EXIT FUNCTION
@pVtbl.pQueryInterface = CODEPTR(IOleInPlaceUIWindow_QueryInterface)
@pVtbl.pAddRef = CODEPTR(IOleInPlaceUIWindow_AddRef)
@pVtbl.pRelease = CODEPTR(IOleInPlaceUIWindow_Release)
@pVtbl.pGetWindow = CODEPTR(IOleInPlaceUIWindow_GetWindow)
@pVtbl.pContextSensitiveHelp = CODEPTR(IOleInPlaceUIWindow_ContextSensitiveHelp)
@pVtbl.pGetBorder = CODEPTR(IOleInPlaceUIWindow_GetBorder)
@pVtbl.pRequestBorderSpace = CODEPTR(IOleInPlaceUIWindow_RequestBorderSpace)
@pVtbl.pSetBorderSpace = CODEPTR(IOleInPlaceUIWindow_SetBorderSpace)
@pVtbl.pSetActiveObject = CODEPTR(IOleInPlaceUIWindow_SetActiveObject)
@pVtbl.pVtblAddr = pVtbl
@pVtbl.cRef = 1
pUnk = VARPTR(@pVtbl.pVtblAddr)
FUNCTION = pUnk
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IOleInPlaceUIWindow_QueryInterface method
' Returns the IUnknown of our class and increments the reference counter.
' ****************************************************************************************
FUNCTION IOleInPlaceUIWindow_QueryInterface (BYVAL pCookie AS IOleInPlaceUIWindowVtbl PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
IF riid = $IID_IOleInPlaceUIWindow THEN
ppvObj = pCookie
INCR @@pCookie.cRef
FUNCTION = %S_OK
ELSE
FUNCTION = %E_NOINTERFACE
END IF
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IOleInPlaceUIWindow_AddRef method
' Increments the reference counter.
' ****************************************************************************************
FUNCTION IOleInPlaceUIWindow_AddRef (BYVAL pCookie AS IOleInPlaceUIWindowVtbl PTR) AS DWORD
INCR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IOleInPlaceUIWindow_Release method
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION IOleInPlaceUIWindow_Release (BYVAL pCookie AS IOleInPlaceUIWindowVtbl 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 IOleInPlaceUIWindow_GetWindow (BYVAL pCookie AS IOleInPlaceUIWindowVtbl PTR, BYREF phwnd AS DWORD) AS LONG
' Put your code here
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Controls enabling of context-sensitive help.
' ****************************************************************************************
FUNCTION IOleInPlaceUIWindow_ContextSensitiveHelp (BYVAL pCookie AS IOleInPlaceUIWindowVtbl PTR, BYVAL fEnterMode AS LONG) AS LONG
' Put your code here
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Specifies a RECT structure for toolbars and controls.
' ****************************************************************************************
FUNCTION IOleInPlaceUIWindow_GetBorder (BYVAL pCookie AS IOleInPlaceUIWindowVtbl PTR, BYREF lprectBorder AS RECT) AS LONG
' Put your code here
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Determines if tools can be installed around object's window frame.
' ****************************************************************************************
FUNCTION IOleInPlaceUIWindow_RequestBorderSpace (BYVAL pCookie AS IOleInPlaceUIWindowVtbl PTR, BYREF pborderwidths AS RECT) AS LONG
' Put your code here
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Allocates space for the border.
' ****************************************************************************************
FUNCTION IOleInPlaceUIWindow_SetBorderSpace (BYVAL pCookie AS IOleInPlaceUIWindowVtbl PTR, BYREF pborderwidths AS RECT) AS LONG
' Put your code here
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Provides for direct communication between the object and each document and frame window.
' ****************************************************************************************
FUNCTION IOleInPlaceUIWindow_SetActiveObject (BYVAL pCookie AS IOleInPlaceUIWindowVtbl PTR, BYVAL pActiveObject AS DWORD, BYVAL pszObjName AS DWORD) AS LONG
' Put your code here
END FUNCTION
' ****************************************************************************************
|
Page last updated on Monday, 03 April 2006 20:33:05 +0200