User32EnumDisplayDevices Method
Retrieves information about the display devices in the current session.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", BestFitMapping = false, ThrowOnUnmappableChar = true,
SetLastError = true)]
public static bool EnumDisplayDevices(
string lpDevice,
uint iDevNum,
ref DisplayDevice refDisplayDevice,
uint flags
)
<DllImportAttribute("User32.dll", BestFitMapping := false, ThrowOnUnmappableChar := true,
SetLastError := true>]
Public Shared Function EnumDisplayDevices (
lpDevice As String,
iDevNum As UInteger,
ByRef refDisplayDevice As DisplayDevice,
flags As UInteger
) As Boolean
Dim lpDevice As String
Dim iDevNum As UInteger
Dim refDisplayDevice As DisplayDevice
Dim flags As UInteger
Dim returnValue As Boolean
returnValue = User32.EnumDisplayDevices(lpDevice,
iDevNum, refDisplayDevice, flags)
public:
[DllImportAttribute(L"User32.dll", BestFitMapping = false, ThrowOnUnmappableChar = true,
SetLastError = true)]
static bool EnumDisplayDevices(
String^ lpDevice,
unsigned int iDevNum,
DisplayDevice% refDisplayDevice,
unsigned int flags
)
[<DllImportAttribute("User32.dll", BestFitMapping = false, ThrowOnUnmappableChar = true,
SetLastError = true)>]
static member EnumDisplayDevices :
lpDevice : string *
iDevNum : uint32 *
refDisplayDevice : DisplayDevice byref *
flags : uint32 -> bool
No code example is currently available or this language may not be supported.
- lpDevice String
-
A pointer to the device name.
If ,
the function returns information for the display adapter(s) on the machine, based on iDevNum.
- iDevNum UInt32
-
An index value that specifies the display device of interest.
The operating system identifies each display device in the current session with an index value.
The index values are consecutive integers, starting at 0.
If the current session has three display devices, for example, they are specified by the index values 0, 1, and 2.
- refDisplayDevice DisplayDevice
-
A pointer to a DisplayDevice structure that receives information about the
display device specified by iDevNum.
Before calling EnumDisplayDevices(String, UInt32, DisplayDevice, UInt32),
you must initialize the SizeOfStruct to the size, in bytes, of DisplayDevice.
- flags UInt32
-
Set this flag to EDD_GET_DEVICE_INTERFACE_NAME (0x00000001) to
retrieve the device interface name for GUID_DEVINTERFACE_MONITOR,
which is registered by the operating system on a per monitor basis.
The value is placed in the DeviceID returned in refDisplayDevice.
The resulting device interface name can be used with SetupAPI functions and
serves as a link between GDI monitor devices and SetupAPI monitor devices.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
The function fails if
iDevNum is greater than the largest device index.