IOleInPlaceUIWindow::SetBorderSpace method

Allocates space for the border requested in the call to IOleInPlaceUIWindow::RequestBorderSpace.


HRESULT SetBorderSpace(
  [in] LPCBORDERWIDTHS pborderwidths


pborderwidths [in]

Pointer to a BORDERWIDTHS structure containing the requested width of the tools, in pixels. It can be NULL, indicating the object does not need any space.

Return value

This method returns S_OK on success. Other possible return values include the following.

Return codeDescription

The rectangle does not lie within the specifications returned by IOleInPlaceUIWindow::GetBorder.



The object must call IOleInPlaceUIWindow::SetBorderSpace. It can do any one of the following:

  • Use its own toolbars, requesting border space of a specific size.
  • Use no toolbars, but force the container to remove its toolbars by passing a valid BORDERWIDTHS structure containing nothing but zeros in the pborderwidths parameter.
  • Use no toolbars but allow the in-place container to leave its toolbars up by passing NULL as the pborderwidths parameter.

The BORDERWIDTHS structure used in this call would generally have been passed in a previous call to IOleInPlaceUIWindow::RequestBorderSpace, which must have returned S_OK.

If an object must renegotiate space on the border, it can call IOleInPlaceUIWindow::SetBorderSpace again with the new widths. If the call to IOleInPlaceUIWindow::SetBorderSpace fails, the object can do a full negotiation for border space with calls to IOleInPlaceUIWindow::GetBorder, IOleInPlaceUIWindow::RequestBorderSpace, and IOleInPlaceUIWindow::SetBorderSpace.

Note  While executing IOleInPlaceUIWindow::SetBorderSpace, do not make calls to the 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 IOleInPlaceUIWindow::SetBorderSpace.


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]






IID_IOleInPlaceUIWindow is defined as 00000115-0000-0000-C000-000000000046

See also