private void watchVirtualDesktopTimer_Tick(object sender, EventArgs e) { if (_VirtualDesktopManager.IsWindowOnCurrentVirtualDesktop(this.Handle) == false) { var currentDesktopID = _GetCurrentDesktop().GetID(); _VirtualDesktopManager.MoveWindowToDesktop(this.Handle, ref currentDesktopID); } }
public void MoveWindowToDesktop(IntPtr TopLevelWindow, Guid CurrentDesktop) { int hr; if ((hr = manager.MoveWindowToDesktop(TopLevelWindow, CurrentDesktop)) != 0) { Marshal.ThrowExceptionForHR(hr); } }
public async Task MoveWindowToDesktop(IntPtr TopLevelWindow, Guid CurrentDesktop) { await Window.Dispatch <object>(() => { int hr; if ((hr = manager.MoveWindowToDesktop(TopLevelWindow, CurrentDesktop)) != 0) { Marshal.ThrowExceptionForHR(hr); } return(null); }); }