public static VirtualDesktop GetCurrentDesktop(this Form form) { return(VirtualDesktop.FromHwnd(form.Handle)); }
/// <summary> /// Returns a virtual desktop that window is located. /// </summary> public static VirtualDesktop GetCurrentDesktop(this Window window) { return(VirtualDesktop.FromHwnd(window.GetHandle())); }