public void SetWindowPositonFailsWithNoWindowTest(WindowPositionTypes positionType)
 {
     _browser.KillAllOpenBrowsers();
     try
     {
         _browser.SetWindowPosition(positionType);
     }
     finally
     {
         // Clean up
         this.OpenSwatTestPage();
     }
 }
 public override void SetWindowPosition(WindowPositionTypes winPosition)
 {
     connectToSafariPlugin();
     setCurrentURI(false);
     sendMessage(_socket, String.Format("SetWindowPosition:~-^{0}^-~", winPosition.ToString().ToUpper()));
     //disconnectSafariPlugin();
 }
 public void SetWindowPosition(WindowPositionTypes windowPositionType)
 {
     _browser.AssertBrowserIsAttached();
     _browser.SetWindowPosition(windowPositionType);
 }
        public virtual void SetWindowPosition(WindowPositionTypes windowPositionType)
        {
            DateTime timeout = DateTime.Now.AddSeconds(2);

            switch (windowPositionType)
            {
                case WindowPositionTypes.MAXIMIZE:
                    NativeMethods.ShowWindow(GetCurrentWindowHandle(), NativeMethods.SW_MAXIMIZE);
                    while (!NativeMethods.IsZoomed(GetCurrentWindowHandle()) && DateTime.Now < timeout)
                    {

                    }
                    break;
                case WindowPositionTypes.MINIMIZE:
                    NativeMethods.ShowWindow(GetCurrentWindowHandle(), NativeMethods.SW_MINIMIZE);
                    while (!NativeMethods.IsIconic(GetCurrentWindowHandle()) && DateTime.Now < timeout)
                    {

                    }
                    break;
                case WindowPositionTypes.BRINGTOTOP:
                    if (!NativeMethods.IsZoomed(GetCurrentWindowHandle()))
                        NativeMethods.ShowWindow(GetCurrentWindowHandle(), NativeMethods.SW_RESTORE);
                    NativeMethods.SetWindowPos(GetCurrentWindowHandle(), HWND_TOPMOST, 0, 0, 0, 0, NativeMethods.SWP_NOMOVE | NativeMethods.SWP_NOSIZE);
                    NativeMethods.SetWindowPos(GetCurrentWindowHandle(), HWND_NOTOPMOST, 0, 0, 0, 0, 0x0003);
                    break;
                //Constant Long SW_HIDE = 0
                //Constant Long SW_NORMAL = 1
                //Constant Long SW_SHOWMINIMIZED = 2
                //Constant Long SW_SHOWMAXIMIZED = 3
                //Constant Long SW_SHOWNOACTIVATE = 4
                //Constant Long SW_SHOW = 5
                //Constant Long SW_MINIMIZE = 6
                //Constant Long SW_SHOWMINNOACTIVE = 7
                //Constant Long SW_SHOWNA = 8
                //Constant Long SW_RESTORE = 9
                //Constant Long SW_SHOWDEFAULT = 10
            }
        }