如何以编程方式更改第三台显示器

如何以编程方式更改第三台显示器

本文介绍了如何以编程方式更改第三台显示器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用笔记本电脑时,我会使用3个显示器:

When I'm using my laptop, I use 3 displays:

  1. 笔记本电脑显示屏
  2. 第二个监视器(通过VGA连接)
  3. 电视(通过HDMI连接)

我的视频卡不支持3台显示器,因此我不断地从2台切换到3台:当我在计算机上时,我使用第二台显示器,而当我想看电影时,等等.第三.

My videocard doesn't support 3 monitors, so I'm constantly switching from 2 to 3: when I'm on the computer, I use the 2nd monitor, and when I want to watch some movies, etc. I use the 3rd.

我当前必须转到屏幕分辨率,选择未使用的显示器,然后选择将桌面扩展到该显示.

I currently have to go to Screen Resolution, select the monitor that is not in use, and choose Extend desktop to this display.

有没有办法使它自动化?

是否有任何命令行工具或任何允许执行此操作的Windows API?

Is there any command-line tool, or any Windows API that allows doing it?

修改:
显示转换器似乎可以满足我的需要,但是问题在于它只能检测到工作中的显示器.未检测到第三个监视器(当前未使用),因此无法附加它.


Display Changer seems to do what I need, but the problem is that it only detects the working monitors. The 3rd monitor (which isn't currently in use) isn't detected, so I can't attach it.

推荐答案

DisplaySwitch.exe上的一点RE表示它调用了

A bit of RE on DisplaySwitch.exe shows that it calls

SetDisplayConfig(0, NULL, NULL, NULL, 0x888)

在我的计算机上将其设置为扩展".

to set it to Extended on my computer.

从那里开始,经过一些挖掘,使我进入了 SetDisplayConfig 文档,以及,其中包含一些示例代码,这些代码可查询您当前的显示状态,并添加实际的标志以更改您的显示状态.

From there, a little digging around got me to the SetDisplayConfig documentation obviously and also this SO page with some example code that queries your current display state and adds the actual flags to change them if you want to do so.

这篇关于如何以编程方式更改第三台显示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 23:58