.
Summary
The
EnumDisplaySettings API enumerates the display settings for the machine (surprise!). It returns a DEVMODE struct which contains the current settings. Use
ChangeDisplaySettings to change those values.
C# Signature:
[DllImport("user32.dll")]
public static extern int EnumDisplaySettings (
string deviceName, int modeNum, ref DEVMODE devMode );
User-Defined Types:
[StructLayout(LayoutKind .Sequential)]
public struct DEVMODE
{
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]
public string dmDeviceName;
public short dmSpecVersion;
public short dmDriverVersion;
...
}
Notes:
None.
Tips & Tricks:
Please add some!
Sample Code:
http://www.codeproject.com/csharp/CSDynamicScrRes.asp?df=100&forumid=38736&select=800137
Alternative Managed API:
Do you know one? Please contribute it!
Documentation
The EnumDisplaySettings API enumerates the display settings for the machine (surprise!). It returns a DEVMODE struct which contains the current settings. Use ChangeDisplaySettings to change those values.
11/11/2019 9:40:00 AM - 85.230.216.217
Changes the display settings via a DEVMODE struct.
8/10/2022 6:59:36 AM - 212.105.175.123
TODO - a short description
3/16/2007 8:17:31 AM - -63.69.129.2