Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ChangeDisplaySettingsEx Upsupported resolution

524 views
Skip to first unread message

Ben Kinslow

unread,
Dec 17, 2008, 10:43:31 AM12/17/08
to
Hi

I am trying to set an "unsupported" screen resolution in Windows using the
ChangeDisplaySettingsEx API call. I get a DISP_CHANGE_BADMODE error. If I
uncheck the "Hide modes that this monitor cannot display" for the monitor
settings the call works and the resolution is displayed correctly. is there
any way to force the "unsupported" display mode, or programatically uncheck
the "Hide modes...." checkbox.

Any help will be greatly appreciated.

Regards
Ben


Christian ASTOR

unread,
Dec 17, 2008, 12:13:01 PM12/17/08
to
On 17 déc, 16:43, "Ben Kinslow"
<ben.kins...@antispamremovethis.baesystems.com> wrote:

> I am trying to set an "unsupported" screen resolution in Windows using the
> ChangeDisplaySettingsEx API call.  I get a DISP_CHANGE_BADMODE error.  If I
> uncheck the "Hide modes that this monitor cannot display" for the monitor
> settings the call works and the resolution is displayed correctly.  is there
> any way to force the "unsupported" display mode, or programatically uncheck
> the "Hide modes...." checkbox.

It's the "PruningMode" value of key returned by EnumDisplayDevices()
(on Vista, might work with ChangeDisplaySettingsEx() & 0x100 or 0x200,
not sure...)

Ben Kinslow

unread,
Dec 18, 2008, 4:40:00 AM12/18/08
to
Thanks for the assistance!

The device does in deed report DISPLAY_DEVICE_MODESPRUNED, but does knowing
that allow me to force a pruned mode?

I tried ChangeDisplaySettingsEx() with 0x100 and 0x200 flags set in dmFields
of the DEVMODE parameter, but no luck - is that what you were suggesting? I
am running XPE!

"Christian ASTOR" <cast...@club-internet.fr> wrote in message
news:e242ce17-b21e-48dc...@z6g2000pre.googlegroups.com...

Christian ASTOR

unread,
Dec 18, 2008, 1:47:16 PM12/18/08
to
On 18 déc, 10:40, "Ben Kinslow"

<ben.kins...@antispamremovethis.baesystems.com> wrote:
> Thanks for the assistance!
>
> The device does in deed report DISPLAY_DEVICE_MODESPRUNED, but does knowing
> that allow me to force a pruned mode?
>
> I tried ChangeDisplaySettingsEx() with 0x100 and 0x200 flags set in dmFields
> of the DEVMODE parameter, but no luck - is that what you were suggesting?  I
> am running XPE!


No.
Set the value of "PruningMode" to 0 with RegSetValueEx()
Then call ChangeDisplaySettings() 2 times
(CDS_TEST then CDS_UPDATEREGISTRY | CDS_NORESET)
then a last time with ChangeDisplaySettings(NULL, 64)

0 new messages