Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Extends the window frame into the client area.
HRESULT DwmExtendFrameIntoClientArea(
[in] HWND hWnd,
[in] const MARGINS *pMarInset
);
[in] hWnd
The handle to the window in which the frame will be extended into the client area.
[in] pMarInset
A pointer to a MARGINS structure that describes the margins to use when extending the frame into the client area.
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
This function must be called whenever Desktop Window Manager (DWM) composition is toggled. Handle the WM_DWMCOMPOSITIONCHANGED message for composition change notification.
Use negative margin values to create the "sheet of glass" effect where the client area is rendered as a solid surface with no window border.
The following sample demonstrates how to extend the bottom margin, creating a large bottom frame.
HRESULT ExtendIntoClientBottom(HWND hwnd)
{
// Set margins, extending the bottom margin
MARGINS margins = {0,0,0,25};
HRESULT hr = S_OK;
// Extend frame on the bottom of client area
hr = DwmExtendFrameIntoClientArea(hwnd,&margins);
if (SUCCEEDED(hr))
{
// ...
}
return hr;
}
The following sample demonstrates the "sheet of glass" effect where the client area is rendered without a window border.
HRESULT ExtendIntoClientAll(HWND hwnd)
{
// Negative margins have special meaning to DwmExtendFrameIntoClientArea.
// Negative margins create the "sheet of glass" effect, where the client area
// is rendered as a solid surface with no window border.
MARGINS margins = {-1};
HRESULT hr = S_OK;
// Extend the frame across the entire window.
hr = DwmExtendFrameIntoClientArea(hwnd,&margins);
if (SUCCEEDED(hr))
{
// ...
}
return hr;
}
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | dwmapi.h |
Library | Dwmapi.lib |
DLL | Dwmapi.dll |
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today