Determines if there is available space for tools to be installed around the object's window frame while the object is active in place.
HRESULT RequestBorderSpace(
LPCBORDERWIDTHS pborderwidths //Pointer to a structure
);
This method supports the standard return values E_INVALIDARG and E_UNEXPECTED, as well as the following:
The active in-place object calls IOleInPlaceUIWindow::RequestBorderSpace to ask if tools can be installed inside the window frame. These tools would be allocated between the rectangle returned by IOleInPlaceUIWindow::GetBorder and the BORDERWIDTHS structure specified in the argument to this call.
The space for the tools is not actually allocated to the object until it calls IOleInPlaceUIWindow::SetBorderSpace, allowing the object to negotiate for space (such as while dragging toolbars around), but deferring the moving of tools until the action is completed.
The object can install these tools by passing the width in pixels that is to be used on each side. For example, if the object required 10 pixels on the top, 0 pixels on the bottom, and 5 pixels on the left and right sides, it would pass the following BORDERWIDTHS structure to IOleInPlaceUIWindow::RequestBorderSpace:
lpbw->top = 10
lpbw->bottom = 0
lpbw->lLeft = 5
lpbw->right = 5
Note While executing IOleInPlaceUIWindow::RequestBorderSpace, do not make calls to the Windows PeekMessage or GetMessage functions, or a dialog box. Doing so may cause the system to deadlock. There are further restrictions on which OLE interface methods and functions can be called from within RequestBorderSpace.
If the amount of space an active object uses for its toolbars is irrelevant to the container, it can simply return NOERROR as shown in the following IOleInPlaceUIWindow::RequestBorderSpace example. Containers should not unduly restrict the display of tools by an active in-place object.
HRESULT InPlaceUIWindow_RequestBorderSpace(
IOleInPlaceFrame * lpThis,
LPCBORDERWIDTHS pborderwidths)
{
/* Container allows the object to have as much border space as it
** wants.
*/
return NOERROR;
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in oleidl.h.
IOleInPlaceUIWindow::GetBorder, IOleInPlaceUIWindow::SetBorderSpace PeekMessage, GetMessage in Win32