User32ChangeDisplaySettingsEx Method
Changes the settings of the specified display device to the specified graphics mode.
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", CharSet = CharSet.Ansi, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
public static DisplaySettingsChange ChangeDisplaySettingsEx(
string lpszDeviceName,
ref DevMode refDevMode,
IntPtr hWnd,
ChangeDisplaySettingsFlags flags,
IntPtr lParam
)
<DllImportAttribute("User32.dll", CharSet := CharSet.Ansi, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function ChangeDisplaySettingsEx (
lpszDeviceName As String,
ByRef refDevMode As DevMode,
hWnd As IntPtr,
flags As ChangeDisplaySettingsFlags,
lParam As IntPtr
) As DisplaySettingsChange
Dim lpszDeviceName As String
Dim refDevMode As DevMode
Dim hWnd As IntPtr
Dim flags As ChangeDisplaySettingsFlags
Dim lParam As IntPtr
Dim returnValue As DisplaySettingsChange
returnValue = User32.ChangeDisplaySettingsEx(lpszDeviceName,
refDevMode, hWnd, flags, lParam)
public:
[DllImportAttribute(L"User32.dll", CharSet = CharSet::Ansi, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static DisplaySettingsChange ChangeDisplaySettingsEx(
String^ lpszDeviceName,
DevMode% refDevMode,
IntPtr hWnd,
ChangeDisplaySettingsFlags flags,
IntPtr lParam
)
[<DllImportAttribute("User32.dll", CharSet = CharSet.Ansi, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member ChangeDisplaySettingsEx :
lpszDeviceName : string *
refDevMode : DevMode byref *
hWnd : IntPtr *
flags : ChangeDisplaySettingsFlags *
lParam : IntPtr -> DisplaySettingsChange
No code example is currently available or this language may not be supported.
- lpszDeviceName String
-
A pointer to a null-terminated string that specifies the display device whose graphics mode will change.
Only display device names as returned by EnumDisplayDevices(String, UInt32, DisplayDevice, UInt32) are valid.
The lpszDeviceName parameter can be .
A value specifies the default display device.
The default device can be determined by calling EnumDisplayDevices(String, UInt32, DisplayDevice, UInt32) and
checking for the DISPLAY_DEVICE_PRIMARY_DEVICE flag.
- refDevMode DevMode
-
A pointer to a DevMode structure that describes the new graphics mode.
If refDevMode is ,
all the values currently in the registry will be used for the display setting.
Passing for the refDevMode parameter and 0 for the flags parameter is the
easiest way to return to the default mode after a dynamic mode change.
- hWnd IntPtr
-
Reserved; must be Zero.
- flags ChangeDisplaySettingsFlags
-
Indicates how the graphics mode should be changed.
- lParam IntPtr
-
If flags is VideoParameters,
lParam is a pointer to a VIDEOPARAMETERS structure.
Otherwise lParam must be Zero.
DisplaySettingsChange
A
DisplaySettingsChange value that specifies the operation result.