Ejemplo n.º 1
0
        /// <summary>
        ///     Minimizes the specified window.
        /// </summary>
        /// <param name="hWnd">
        ///     A pointer to the window to minimize.
        /// </param>
        /// <returns>
        ///     <c>true</c> if the specified window was successfully minimized; otherwise <c>false</c>.
        /// </returns>
        public static bool Minimize(IntPtr hWnd)
        {
            if (hWnd == IntPtr.Zero)
            {
                return(false);
            }

            if (WindowAPI.ShowWindowAsync(hWnd, ShowWindowCommand.SW_SHOWMINIMIZED))
            {
                return(true);
            }

            return(false);
        }