public bool Equals( WindowInfo other )
        {
            if ( ReferenceEquals( null, other ) )
            {
                return false;
            }

            return ReferenceEquals( this, other ) || other.Handle.Equals( Handle );
        }
 /// <summary>
 ///   Find the next window below the specified window.
 /// </summary>
 /// <returns>The next window below the specified window, or null when the specified window is at the bottom.</returns>
 public static WindowInfo GetWindowBelow( WindowInfo window )
 {
     IntPtr windowHandle = User32.GetWindow( window.Handle, User32.WindowRelationship.Next );
     return windowHandle == IntPtr.Zero ? null : new WindowInfo( windowHandle );
 }
示例#3
0
		/// <summary>
		///   Removes the passed window from the virtual desktop and hides it.
		/// </summary>
		/// <param name = "toRemove">The window to remove.</param>
		public void RemoveWindow( WindowInfo toRemove )
		{
			_windows.Remove( toRemove );
			toRemove.Hide();
		}
示例#4
0
		/// <summary>
		///   Adds the passed window to the virtual desktop and activates it.
		/// </summary>
		/// <param name = "toAdd">The window to add.</param>
		public void AddWindow( WindowInfo toAdd )
		{
			_windows.Add( toAdd );
			toAdd.Show();
		}	
示例#5
0
		/// <summary>
		///   Cut a given window from the currently open desktop and store it in a clipboard.
		///   TODO: What if a window from a different desktop is passed? Should this be supported?
		/// </summary>
		/// <param name="window"></param>
		public void CutWindow( WindowInfo window )
		{
			if ( IsValidWindow( window ) )
			{
				_windowClipboard.Push( window );
				CurrentDesktop.RemoveWindow( window );
			}
		}
示例#6
0
		bool IsValidWindow( WindowInfo window )
		{
			bool valid =
				!window.IsDestroyed() && window.IsVisible() &&
				!IgnoreProcesses.Contains( new Tuple<string, string>( window.GetProcess().ProcessName, window.GetClassName() ) ) &&
				_customWindowFilters.All( f => f( window ) );

			return valid;
		}