Ejemplo n.º 1
0
        public bool Show(WindowShowState showState = WindowShowState.Current, bool activate = true)
        {
            switch (showState)
            {
            case WindowShowState.Default:
                return(NativeMethods.ShowWindow(_hwnd, SW.SHOWDEFAULT));

            case WindowShowState.Current:
                return(NativeMethods.ShowWindow(_hwnd, activate ? SW.SHOW : SW.SHOWNA));

            case WindowShowState.Normal:
                return(NativeMethods.ShowWindow(_hwnd, activate ? SW.SHOWNORMAL : SW.SHOWNOACTIVATE));

            case WindowShowState.Minimized:
                return(NativeMethods.ShowWindow(_hwnd, activate ? SW.SHOWMINIMIZED : SW.SHOWMINNOACTIVE));

            case WindowShowState.Maximized:
                return(NativeMethods.ShowWindow(_hwnd, SW.SHOWMAXIMIZED));

            default:
                return(false);
            }
        }
Ejemplo n.º 2
0
        public bool Show(WindowShowState showState = WindowShowState.Current, bool activate = true)
        {
            switch (showState) {
                case WindowShowState.Default:
                    return NativeMethods.ShowWindow(_hwnd, SW.SHOWDEFAULT);

                case WindowShowState.Current:
                    return NativeMethods.ShowWindow(_hwnd, activate ? SW.SHOW : SW.SHOWNA);

                case WindowShowState.Normal:
                    return NativeMethods.ShowWindow(_hwnd, activate ? SW.SHOWNORMAL : SW.SHOWNOACTIVATE);

                case WindowShowState.Minimized:
                    return NativeMethods.ShowWindow(_hwnd, activate ? SW.SHOWMINIMIZED : SW.SHOWMINNOACTIVE);

                case WindowShowState.Maximized:
                    return NativeMethods.ShowWindow(_hwnd, SW.SHOWMAXIMIZED);

                default:
                    return false;
            }
        }