简体   繁体   English

如何以编程方式断开所选显示器的连接

[英]How to programmatically disconnect chosen display

So, I have a 3 monitor setup on my windows machine, and whenever I'm performing graphically intense operations, such as rendering 3d models, playing video games, or rendering video footage, its taking a severe performance hit due to all the extra screens adding lots of overhead. 因此,我在Windows机器上设置了3个监视器,每当执行图形密集型操作时,例如渲染3D模型,玩视频游戏或渲染视频画面,由于所有额外的屏幕,其性能都会受到严重影响增加很多开销。

I can prevent this overhead by disconnecting/disabling my screens from control panel, or pulling the displayport cables out. 我可以通过从控制面板断开/禁用屏幕或拉出Displayport电缆来避免这种开销。 Just turning the screens off doesn't help. 仅关闭屏幕并没有帮助。

So I was wondering if .NET or atleast user32.dll or something had utilities for disconnecting a selected screen programmatically so it dissapears from the selectable monitors you can find in the Control Panel (settings in W10) ? 因此,我想知道.NET或atleast user32.dll或某些工具是否具有用于以编程方式断开选定屏幕的实用程序,以便它与您可以在“控制面板”中找到的可选显示器(在W10中的设置)中消失了?

I tried looking for similar questions/answers and this is the closest I got: Turn on/off monitor 我试图寻找类似的问题/答案,这是我得到的最接近的问题: 打开/关闭显示器

However trying that, it does disconnect both of my screens, but brings them back up after a few seconds 但是尝试这样做,它的确断开了我两个屏幕的连接,但几秒钟后又将它们恢复了

You can use the MultiMonitorTool by Nirsoft: 您可以使用MultiMonitorTool通过Nirsoft:

MultiMonitorTool is a small tool that allows you to do some actions related to working with multiple monitors. MultiMonitorTool是一个小型工具,可让您执行一些与使用多个监视器有关的操作。 With MultiMonitorTool, you can disable/enable monitors, set the primary monitor, save and load the configuration of all monitors, and move windows from one monitor to another. 使用MultiMonitorTool,您可以禁用/启用监视器,设置主监视器,保存和加载所有监视器的配置,以及将窗口从一个监视器移到另一监视器。 You can do these actions from the user interface or from command-line, without displaying user interface. 您可以从用户界面或命令行执行这些操作,而无需显示用户界面。 MultiMonitorTool also provides a preview window, which allows you to watch a preview of every monitor on your system. MultiMonitorTool还提供一个预览窗口,使您可以观看系统上每个监视器的预览。

Examples to disable a monitor or multiple monitors: 禁用一个或多个监视器的示例:

MultiMonitorTool.exe /disable 1
MultiMonitorTool.exe /disable \\.\DISPLAY3
MultiMonitorTool.exe /disable 1 2 3

Examples to enable a monitor: 启用监视器的示例:

MultiMonitorTool.exe /enable 3
MultiMonitorTool.exe /enable \\.\DISPLAY1
MultiMonitorTool.exe /enable 3 2

Source MultiMonitorTool . MultiMonitorTool

See the source link above for more information. 有关更多信息,请参见上面的源链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM