IDirect3D9::GetAdapterMonitor method (d3d9.h)

Returns the handle of the monitor associated with the Direct3D object.

Syntax

HMONITOR GetAdapterMonitor(
  [in] UINT Adapter
);

Parameters

[in] Adapter

Type: UINT

Ordinal number that denotes the display adapter. D3DADAPTER_DEFAULT is always the primary display adapter.

Return value

Type: HMONITOR

Handle of the monitor associated with the Direct3D object.

Remarks

As shown in the following code fragment, which illustrates how to obtain a handle to the monitor associated with a given device, use GetDirect3D to return the Direct3D enumerator from the device and use GetCreationParameters to retrieve the value for Adapter.


    if( FAILED( pDevice->GetCreationParameters(  &Parameters ) ) )
        return D3DERR_INVALIDCALL;
    
    if( FAILED( pDevice->GetDirect3D(&pD3D) ) )
        return D3DERR_INVALIDCALL;
    
    hMonitor = pD3D->GetAdapterMonitor(Parameters.AdapterOrdinal);
    
    pD3D->Release();

Requirements

Requirement Value
Target Platform Windows
Header d3d9.h (include D3D9.h)
Library D3D9.lib

See also

GetCreationParameters

GetDirect3D

IDirect3D9