在Windows中的桌面之间移动应用程序 [英] Moving applications between desktops in Windows

查看:148
本文介绍了在Windows中的桌面之间移动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚如何发送正在运行的应用程序,以使用CreateDesktop创建新的Windows桌面.

I am trying to figure out how can I send a running application do a new Windows desktop created with CreateDesktop.

我可以创建一个新的桌面,然后在其中启动一个应用程序,但我找不到在运行的应用程序中执行此操作的方法.与桌面管理相关的所有功能(i.ec,SetThreadDesktop)始终仅适用于当前线程

I can create a new Desktop, and then launch an application in it, bug I can't find the way to do it with a running application. All functions related to Desktop management (i.ec, SetThreadDesktop) always apply only to current thread

有任何提示吗?

谢谢您的回答.

事实上,我需要做的是移动不是由我开发的应用程序(即notepad.exe)

Well, in fact, what I need to do is moving applications not developed by me (i.e, notepad.exe)

如果从Powertoys看虚拟桌面管理器( http://www. microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx ),它会在同一WindowStation中创建多个虚拟桌面. 我知道有类似的应用程序可以将正在运行的应用程序(notepad.exe,calc.exe ..)从一个虚拟桌面移动到另一个虚拟桌面,而无需关闭它并再次将其重新打开(然后传递新的桌面句柄[HDESK]在调用CreateProcess时),但是即使在阅读了所有相关的msdn文档之后,我仍然不知道该怎么做:|

If look at Virtual Desktop Manager from Powertoys (http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx), it creates several virtual desktops in the same WindowStation. I know there are similar applications that can move running apps (notepad.exe, calc.exe..) from one virtual desktop to another, without the need of closing it and reopening it again (and then passing the new desktop handle [HDESK] on the call to CreateProcess), but even after reading all the related msdn documentation, I still can not figure how to do it :|

我也考虑过SetProcessWindowStation,但是到目前为止,使用CreateDesktop函数创建的所有新虚拟桌面都在同一WindowStation上,所以...

I thought on SetProcessWindowStation too, but as far as I now, all new virtual desktops created with CreateDesktop function are on the same WindowStation, so...

也许我错过了什么?

推荐答案

窗口资源(例如HWND)特定于桌面.如果您在一个桌面上创建一个窗口,我将看不到如何将其移动到另一个桌面.例如,您的应用程序使用的HWND可能已在其他桌面上使用.

Window resources (such as HWNDs) are specific to a desktop. If you create a window in one desktop, I can't see how you would be able to move it to another desktop. For example, the HWNDs used by your application might already be in use in the other desktop.

虚拟桌面管理器不必使用Windows桌面-他们可以通过操纵窗口来产生相同的效果.看看 VirtuaWin ,它是开源的虚拟桌面管理器.

Virtual Desktop Managers don't have to use Windows Desktops -- they can create the same effect by manipulating the windows. Take a look at VirtuaWin, an open source Virtual Desktop Manager.

这篇关于在Windows中的桌面之间移动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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