Exemple #1
0
 /// <summary>
 /// Restores current window to its original dimensions
 /// </summary>
 /// <param name="windowHandle">NativeWindowHandle to window</param>
 /// <exception cref="ProdOperationException">Examine inner exception</exception>
 public static void WindowRestore(IntPtr windowHandle)
 {
     try
     {
         WindowPatternHelper.SetVisualState(AutomationElement.FromHandle(windowHandle), WindowVisualState.Normal);
     }
     catch (InvalidOperationException err)
     {
         throw new ProdOperationException(err.Message, err);
     }
     catch (ElementNotAvailableException err)
     {
         throw new ProdOperationException(err.Message, err);
     }
     catch (ArgumentException err)
     {
         throw new ProdOperationException(err.Message, err);
     }
 }
Exemple #2
0
 /// <summary>
 /// Minimizes the current window
 /// </summary>
 /// <param name="windowHandle">NativeWindowHandle to window</param>
 /// <exception cref="ProdOperationException">Examine inner exception</exception>
 public static void WindowMinimize(IntPtr windowHandle)
 {
     try
     {
         WindowPatternHelper.SetVisualState(AutomationElement.FromHandle(windowHandle), WindowVisualState.Minimized);
     }
     catch (InvalidOperationException)
     {
         ProdWindowNative.MinimizeWindowNative(windowHandle);
     }
     catch (ElementNotAvailableException err)
     {
         throw new ProdOperationException(err.Message, err);
     }
     catch (ArgumentException err)
     {
         throw new ProdOperationException(err.Message, err);
     }
     catch (Win32Exception werr)
     {
         throw new ProdOperationException(werr.Message, werr);
     }
 }
Exemple #3
0
        //private static void NativeRestoreWindow(ProdWindow baseControl)
        //{
        //    ProdWindowNative.ShowWindowNative(baseControl.NativeHandle);
        //}

        private static void UiaRestoreWindow(ProdWindow baseControl)
        {
            WindowPatternHelper.SetVisualState(baseControl.UIAElement, WindowVisualState.Normal);
            LogController.ReceiveLogMessage(new LogMessage("restored"));
        }
Exemple #4
0
        //private static void NativeMaximizeWindow(ProdWindow baseControl)
        //{
        //    ProdWindowNative.MaximizeWindowNative(baseControl.NativeHandle);
        //}

        private static void UiaMaximizeWindow(ProdWindow baseControl)
        {
            WindowPatternHelper.SetVisualState(baseControl.UIAElement, WindowVisualState.Maximized);
            LogController.ReceiveLogMessage(new LogMessage("maximized"));
        }