Export (0) Print
Expand All

DwmGetWindowAttribute function

Retrieves the current value of a specified attribute applied to a window.

Syntax


HRESULT WINAPI DwmGetWindowAttribute(
  HWND hwnd,
  DWORD dwAttribute,
  _Out_  PVOID pvAttribute,
  DWORD cbAttribute
);

Parameters

hwnd

The handle to the window from which the attribute data is retrieved.

dwAttribute

The attribute to retrieve, specified as a DWMWINDOWATTRIBUTE value.

pvAttribute [out]

A pointer to a value that, when this function returns successfully, receives the current value of the attribute. The type of the retrieved value depends on the value of the dwAttribute parameter.

cbAttribute

The size of the DWMWINDOWATTRIBUTE value being retrieved. The size is dependent on the type of the pvAttribute parameter.

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Examples

The following example demonstrates how to determine whether nonclient-area rendering is enabled.



HRESULT IsNCRenderingEnabled(HWND hwnd, BOOL enabled)
{
   HRESULT hr = S_OK;
	
   hr = DwmGetWindowAttribute(hwnd, DWMWA_NCRENDERING_ENABLED, &enabled, sizeof(BOOL));

   if (SUCCEEDED(hr))
   {
      // Use the retrieved information.
   }
   return hr;
}

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Dwmapi.h

Library

Dwmapi.lib

DLL

Dwmapi.dll

See also

DwmSetWindowAttribute
Enable and Control DWM Composition

 

 

Community Additions

ADD
Show:
© 2014 Microsoft