GetPhysicalMonitorsFromIDirect3DDevice9 function

Retrieves the physical monitors associated with a Direct3D device.


HRESULT GetPhysicalMonitorsFromIDirect3DDevice9(
  IDirect3DDevice9   *pDirect3DDevice9,
  DWORD              dwPhysicalMonitorArraySize,
  LPPHYSICAL_MONITOR pPhysicalMonitorArray



Pointer to the IDirect3DDevice9 interface of the Direct3D device.


Number of elements in pPhysicalMonitorArray. To get the required size of the array, call GetNumberOfPhysicalMonitorsFromIDirect3DDevice9.


Pointer to an array of PHYSICAL_MONITOR structures. The caller must allocate the array.

Return Value

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


A single Direct3D device can be associated with more than one physical monitor. This function returns a handle and a text description for each physical monitor.

When you are done using the monitor handles, close them by passing the pPhysicalMonitorArray array to the DestroyPhysicalMonitors function.


Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header physicalmonitorenumerationapi.h
Library Dxva2.lib
DLL Dxva2.dll

See Also

Monitor Configuration Functions