DirectX9 seems an overkill, but does the enumeration of the supported modes
quite nicely:
foreach( AdapterInformation ai in Manager.Adapters)
{
// ai.CurrentDisplayMode.Width,
// ai.CurrentDisplayMode.Height,
// ai.CurrentDisplayMode.Format
foreach( DisplayMode dm in ai.SupportedModes)
{
// dm.Width,
// dm.Height,
// dm.Format (RGB)
}
}
Note that it only pumps out modes supported by DirectX. Some old graphic
cards, are example, support 24 bits - R8G8B8, but DirectX does NOT support
that mode, so it won't be listed.
If you use generic driver for the monitor, some mode may not work properly
(so the standard button to click within few seconds when you dynamically
change of resolution).
If you have two adapters, both are reported.
I am not aware of a 'native' mode. Do you mean 'actual', if so, use the
CurrentDisplayMode rather than using the innermost enumeration.
Vanderghast, Access MVP
<BMKwrote in message news:Ow**************@TK2MSFTNGP03.phx.gbl...
Hi,
I need to get the the display monitor native resolution.I have tried
SystemInformation.PrimaryMonitorSize. it is giving the exisiting
resolution of the display monitor that is connected.
Please help me out to find the way to get the native resolution of the
monitor that is connected
-BMK