示例#1
0
 private void watchVirtualDesktopTimer_Tick(object sender, EventArgs e)
 {
     if (_VirtualDesktopManager.IsWindowOnCurrentVirtualDesktop(this.Handle) == false)
     {
         var currentDesktopID = _GetCurrentDesktop().GetID();
         _VirtualDesktopManager.MoveWindowToDesktop(this.Handle, ref currentDesktopID);
     }
 }
示例#2
0
        public void MoveWindowToDesktop(IntPtr TopLevelWindow, Guid CurrentDesktop)
        {
            int hr;

            if ((hr = manager.MoveWindowToDesktop(TopLevelWindow, CurrentDesktop)) != 0)
            {
                Marshal.ThrowExceptionForHR(hr);
            }
        }
示例#3
0
        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);
            });
        }