使用桌面复制API在win 10中复制虚拟桌面? [英] Duplicating virtual desktops in win 10 by using Desktop Duplication API?

查看:424
本文介绍了使用桌面复制API在win 10中复制虚拟桌面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 我正在寻找一种方法来复制您可以在Windows 10中设置的虚拟桌面。 


桌面复制API(https://) msdn.microsoft.com/en-us/library/windows/desktop/hh404487(v=vs.85).aspx)适用于虚拟桌面,还是只适用于插入计算机的屏幕?


如果是的话,有人能指出我正确的方向吗?我是Unity C#开发人员,目标是在VR应用程序中获取多个桌面。到目前为止,我一直在使用开源插件来实现使用桌面复制API的统一,但是如果在win10中使用新的虚拟桌面功能的想法是可行的话,我想自己深入挖掘它。 


我在理论上知道它应该可以工作,因为我可以在显示设置中设置一个新功能的显示器,即使我没有插入额外的显示器,我可以访问这个" ;虚拟监视器"使用API​​。


任何想法?


非常感谢! 



 

解决方案

您是否尝试过上述示例:
https://code.msdn.microsoft.com/windowsdesktop/Desktop-Duplication-Sample-da4c696a
?在Visual Studio 2015中打开解决方案文件,确认项目升级,然后运行。它是在C ++中使用
OpenInputDesktop 函数。我认为您应该尝试使用 OpenDesktop 或其他功能(例如
EnumDesktops )来提供虚拟桌面的 HDESK


 I am looking for a way to duplicate the virtual desktops you can set up in windows 10. 

Would the Desktop Duplication API (https://msdn.microsoft.com/en-us/library/windows/desktop/hh404487(v=vs.85).aspx) work for virtual desktops or only for screens plugged into the computer?

If yes, could anyone point me in the right direction? I am a Unity C# developer, and the goal is to get multiple desktops in a VR application. So far I have been using open source plugins for unity that use the desktop duplication API, but I would like to dig into it myself, if the idea of using the new virtual desktops feature in win10 is doable. 

I know in theory it should work, as I can set up a new functioning monitor in the Display Settings even though I don't have an extra monitor plugged in, and I can access this "virtual monitor" using the API.

Any ideas?

Thank you very much! 

 

解决方案

Have you tried the mentioned sample: https://code.msdn.microsoft.com/windowsdesktop/Desktop-Duplication-Sample-da4c696a? Open the solution file in Visual Studio 2015, confirm the project upgrade, and run. It is in C++ and uses the OpenInputDesktop function. I think that you should try OpenDesktop instead or other functions (e.g. EnumDesktops) that give HDESK of virtual desktops.


这篇关于使用桌面复制API在win 10中复制虚拟桌面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆