virtual-desktop

How to move a window between desktops using powershell/.net on windows 10

纵然是瞬间 提交于 2021-02-07 02:55:53
问题 I'd like to be able to using powershell start a process and move any windows created by that process to a particular virtual desktop. Any ideas? 回答1: The Windows SDK Support Team Blog posted a C# demo to switch Desktops via IVirtualDesktopManager: [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("a5cd92ff-29be-454c-8d04-d82879fb3f1b")] [System.Security.SuppressUnmanagedCodeSecurity] public interface IVirtualDesktopManager { [PreserveSig] int

Windows 10 IVirtualDesktopManager::MoveWindowToDesktop

独自空忆成欢 提交于 2020-01-01 10:15:50
问题 I've been trying to use IVirtualDesktopManager::MoveWindowToDesktop to move windows between virtual desktops. Using it on my own windows works great but unfortunately it fails with E_ACCESSDENIED when I try to use it on the window of another process. Sadly "Launch as admin" is not good enough for it. Am I missing something that I don't know about COM interfaces or is it just badly designed ? 回答1: You can move a window not owned by the executing process, but it requires the use of additional,

Windows 10 IVirtualDesktopManager::MoveWindowToDesktop

亡梦爱人 提交于 2020-01-01 10:13:02
问题 I've been trying to use IVirtualDesktopManager::MoveWindowToDesktop to move windows between virtual desktops. Using it on my own windows works great but unfortunately it fails with E_ACCESSDENIED when I try to use it on the window of another process. Sadly "Launch as admin" is not good enough for it. Am I missing something that I don't know about COM interfaces or is it just badly designed ? 回答1: You can move a window not owned by the executing process, but it requires the use of additional,

How to use the IVirtualDesktopManager interface in C++/Win32

流过昼夜 提交于 2019-12-11 07:58:47
问题 I need to search for maximized windows from Win32 (by using EnumWindows ) but I also want to filter for windows which are on the current virtual desktop. On MSDN, I found a page about the IVirtualDesktopManager interface but there seems to be no information on how to use this interface. IVirtualDesktopManager::IsWindowOnCurrentVirtualDesktop(/*args...*/); Throws the following error: Non static member reference must be relative to a specific object VirtualDesktopManager mVirtualDeskManager;

Persistent window across multiple windows 10 virtual desktops?

天大地大妈咪最大 提交于 2019-12-01 13:24:08
I have C# WPF program with multiple windows. I've added support for windows 10 desktops, but the users would like some windows to stay on the screen when moving between desktops. For example if window A is opened on the first desktop and they flip to the second desktop they want window A to stay in the same location on the new desktop. The only functions I'm aware of are from the VirtualDesktopManager: GetWindowsDesktopId() IsWindowOnCurrentVirtualDesktop() MoveWindowToDesktop() Is there a way to do this? Also is there a way to detect when a desktop flip has been initiated? Because if so I

Persistent window across multiple windows 10 virtual desktops?

ぃ、小莉子 提交于 2019-12-01 09:51:55
问题 I have C# WPF program with multiple windows. I've added support for windows 10 desktops, but the users would like some windows to stay on the screen when moving between desktops. For example if window A is opened on the first desktop and they flip to the second desktop they want window A to stay in the same location on the new desktop. The only functions I'm aware of are from the VirtualDesktopManager: GetWindowsDesktopId() IsWindowOnCurrentVirtualDesktop() MoveWindowToDesktop() Is there a

API for Windows 10 virtual desktops

南笙酒味 提交于 2019-11-28 03:34:24
Is there any way to enumerate, switch, add virtual desktops and move window between desktops from code? Preferably, WinAPI. The Windows SDK Support Team Blog posted a C# demo to switch Desktops via IVirtualDesktopManager: [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("a5cd92ff-29be-454c-8d04-d82879fb3f1b")] [System.Security.SuppressUnmanagedCodeSecurity] public interface IVirtualDesktopManager { [PreserveSig] int IsWindowOnCurrentVirtualDesktop( [In] IntPtr TopLevelWindow, [Out] out int OnCurrentDesktop ); [PreserveSig] int GetWindowDesktopId( [In] IntPtr TopLevelWindow

API for Windows 10 virtual desktops

≡放荡痞女 提交于 2019-11-27 00:03:43
问题 Is there any way to enumerate, switch, add virtual desktops and move window between desktops from code? Preferably, WinAPI. 回答1: The Windows SDK Support Team Blog posted a C# demo to switch Desktops via IVirtualDesktopManager: [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("a5cd92ff-29be-454c-8d04-d82879fb3f1b")] [System.Security.SuppressUnmanagedCodeSecurity] public interface IVirtualDesktopManager { [PreserveSig] int IsWindowOnCurrentVirtualDesktop( [In] IntPtr