User32EnumDisplaySettings(String, EnumDisplaySettingsMode, 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,
	EnumDisplaySettingsMode mode,
	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.

mode  EnumDisplaySettingsMode
The type of information to be retrieved.
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