多显示器(Multiple Display Monitors)编程-关于多重独立显示(Multiple independent displays)和桌面扩展(Large desktops)

来源:互联网 发布:期货公司业务流程知乎 编辑:程序博客网 时间:2024/06/07 00:06

 


通过这一段时间的资料查找,和实际编程,得到点启发,总结一下关于多显示器输出的问题。:

多重独立Multiple independent displays这种模式,只要不是刀架到脖子上了,最好不要采用。


先说说这种模式的限制

1 win98以上的系统(应该没人用win95)需要至少2块独立的显卡。一卡多头是不可以的。这一点微软就没说清楚。

2 gdi+openGL不支持。

3 重起后模式可能会被改为桌面扩展。


我只有一块显卡,所以CreateDC()失败,这种方式就没有再试验。

可以看看,前人和微软工程师的讨论。

http://groups.google.com.au/group/microsoft.public.win32.programmer.kernel/browse_frm/thread/575f1452aacd4c8b/7b084cd3e8558f38?lnk=st&q=nvidia+createdc+%22%5C%5C.%5CDISPLAY1%22&rnum=1#7b084cd3e8558f38

这种方式用不了只好改用桌面扩展(Large desktops模式模拟。


我的项目只有两个显示器,在副显示器上显示程序中得到的图像数据。

1 建立一个非模态的对话框,把所有附加的东西去掉,模式改为child。这样程序运行的时候,将对话框铺满整个副显示器,底色改为白色(这个根据个人需要),形成一个大的画布。

2 初始程序的时候 建立副显示器的DC,可以用CreateDC(),之后再需要的时候就可以将图像画到副显示器上。

3 关闭主程序,对话框也会销毁,副显示器恢复原来的桌面。

不足之处 :虽然可以限制鼠标不进入副显示器,但拖动的窗口无法限制。主程序最小化时,副窗口中的对话框也会最小化。

 

编码可参考,DC的创建,显示器的句柄都很容易得到。

http://www.codeproject.com/KB/GDI/multimon.aspx

 

最后相关资料

参考MSDN--- How to Exploit Multiple Monitor Supportin Memphis and Windows NT 5.0

Theory and Operation of Multiple Monitors


Although your needs obviously will dictate how you set up yoursystem, I'll discuss three options here for using multiple monitors.

Large desktops The Windows desktop can now cover more than one monitor with norestrictions on size, position, resolution, or refresh rates (see Figure 1).The system can be configured to the size and relative position of each monitor.Applications can be moved seamlessly from one monitor to another, or bedisplayed simultaneously on more than one monitor.


Screen duplication/remote displayAlternatively, you can use secondary monitors to display the same data as theprimary monitor (see Figure 2). This would be useful for training or forpresentations to a group.Screen duplication could also be used to controlremote applications such as in a support situation or for telecommuting.
Multiple independent displays Amonitor does not need to be part of the Windows desktop for applications tohave access to it. Applications can make use of an additional display even ifit isn't part of the desktop. For example, if you have a large, high-resolutiondisplay for a CAD application, your application can use that monitor for outputthrough Windows APIs, without requiring it to be part of the virtual desktop.That means you don't have to worry about accidentally dragging windows ontothat screen. It's like having a display monitor you can draw on via GDI, but itisn't part of the Windows desktop so you don't have a taskbar or any othershell goodies to worry about.

 

基本原理
Windows 9
8以上操作系统提供监视器的支主要有以下三个模式:
1.
更大的桌面(桌面扩展):示器模式,可以把示器示区域合在一起
Windows桌面,不管示器的尺寸、物理位置、分辨率和刷新率是否相同。
当我运行一个用程序,程序的主窗口可以位于任何一个示器示区域内,也可
以跨示区域。我也可以把一个程序的窗口从一个示区域移到另一个示区域
中。
2.
屏幕制或:可以两个示器示相同的内容。在行培或者
向众人行演示,个特点是很有用的。利用个特性,支持人员还可以对应用程
监视调试
3.
多重独立:在以上的两模式,所有的示区域都是Windows桌面的一部
,但是在多重独立模式,用程序访问示器并不属于Windows桌面。假
的第二个示器是一个高分辨率的大尺寸示器,可以把它用做CAD用程序
示。通CAD用程序中用新的WindowsAPI,可以借助GDI在上面画
独立示器示区域没有桌面上的任何(务栏和快捷方式),它与Windows桌面是
独立的。可以避免Windows桌面对应用程序出的任何干,也不用担心会在无意
中把其它的窗口拽到独立示的示区域中,这种方式就好像为应用程序提供了一个
示器

原创粉丝点击