User32EnumDisplaySettings(String, Int32, DevMode) Method

Retrieves information about one of the graphics modes for a display device.

To retrieve information for all the graphics modes of a display device, make a series of calls to this function.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", CharSet = CharSet.Ansi, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static bool EnumDisplaySettings(
	string deviceName,
	int index,
	ref DevMode refDevMode
)

Parameters

deviceName  String
A pointer to a null-terminated string that specifies the display device about whose graphics mode the function will obtain information.

This parameter is either or a DISPLAY_DEVICE.DeviceName returned from EnumDisplayDevices(String, UInt32, DisplayDevice, UInt32).

A value specifies the current display device on the computer on which the calling thread is running.

index  Int32
The graphics mode index.

Graphics mode indices start at zero.

To obtain information for all of a display device's graphics modes, make a series of calls to EnumDisplaySettings(String, EnumDisplaySettingsMode, DevMode), as follows:

Set index to zero for the first call, and increment index by one for each subsequent call. Continue calling the function until the return value is .

refDevMode  DevMode
A pointer to a DevMode structure into which the function stores information about the specified graphics mode.

Before calling EnumDisplaySettings(String, EnumDisplaySettingsMode, DevMode), set the SizeOfStruct member to Marshal.SizeOf(Of DevMode), and set the DriverExtra member to indicate the size, in bytes, of the additional space available to receive private driver data.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is .

Remarks

See Also