Microsoft DirectX 8.1 (Visual Basic) |
Returns the handle of the monitor associated with the Microsoft® Direct3D® object.
object.GetAdapterMonitor( _ Adapter As Long) As Long
Handle of the monitor associated with the Direct3D object.
If the method fails, an error is raised and Err.Number can be set to one of the following values.
D3DERR_INVALIDCALL |
D3DERR_OUTOFVIDEOMEMORY |
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
As shown in the following code fragment, which illustrates how to obtain a handle to the monitor associated with a given device, use Direct3DDevice8.GetDirect3D to return the Direct3D enumerator from the device, and use Direct3DDevice8.GetCreationParameters to retrieve the value for Adapter.
Dim Device As Direct3DDevice8, D3D As Direct3DDevice8 Dim Parameters As D3DDEVICE_CREATION_PARAMETERS Dim MonitorHandle As Long ' The following code fragment assumes that the above items have been properly created and initialized If ((Device.GetCreationParameters(Parameters) <= 0) And (Device.GetDirect3D(D3D) <= 0)) Then MonitorHandle = D3D.GetAdapterMonitor(Parameters.AdapterOrdinal) Else ' Error handling code here End If
Direct3DDevice8.GetCreationParameters, Direct3DDevice8.GetDirect3D