How to disable a secondary monitor (with ChangeDisplaySettingsEx)?

后端 未结 2 762
长发绾君心
长发绾君心 2021-01-12 21:01

I\'m trying to follow the instructions on MSDN given here to disable a secondary monitor.

I\'m trying to use specifically this set of functions to allow compatibilit

2条回答
  •  时光取名叫无心
    2021-01-12 21:30

    A similar solution is hinted at here:

    http://support.microsoft.com/kb/308216

    This works for attaching screens. However, even armed with that knowledge, the ChangeDisplaySettingsEx documentation on how to detach a screen is also wrong about the DevMode fields that need to be set. As you noticed, you have to set not only DM_POSITION, but also DM_PELSHEIGHT | DM_PELSWIDTH.

    In Windows 7 there's a new SetDisplayConfig API, but I have no personal experience with it yet. Hopefully it's better documented!

提交回复
热议问题