ACAT.Lib.Core.Utility.User32Interop.ShowWindow C# (CSharp) Метод

ShowWindow() приватный Метод

private ShowWindow ( int hwnd, int command ) : int
hwnd int
command int
Результат int
        public static extern int ShowWindow(int hwnd, int command);

Usage Example

Пример #1
0
        /// <summary>
        /// Maximizes the specified window in the monitor other than the
        /// one it is currently in
        /// </summary>
        /// <param name="handle">Window handle</param>
        public static void MaximizeWindowInOtherMonitor(IntPtr handle)
        {
            if (handle == IntPtr.Zero || !MultipleMonitors || Windows.IsMinimized(handle))
            {
                return;
            }

            var scr = GetMonitorForHandle(handle);

            var other = scr.Primary ? GetSecondaryMonitor() : GetPrimaryMonitor();

            if (Windows.IsMaximized(handle))
            {
                Windows.RestoreWindow(handle);
            }

            User32Interop.RECT rect;
            User32Interop.GetWindowRect(handle, out rect);
            User32Interop.MoveWindow(handle, other.WorkingArea.Left, other.WorkingArea.Top, rect.right - rect.left, rect.bottom - rect.top, true);
            User32Interop.ShowWindow(handle.ToInt32(), Windows.ShowWindowFlags.SW_SHOWMAXIMIZED);
        }