Ejemplo n.º 1
0
 public static void ReturnToDesktop()
 {
     Shell32.Shell shell = new Shell32.Shell();
     shell.ToggleDesktop();
     //foreach(Window window in Application.Current.Windows)
     //{
     //    if(window.Title == "Menu" && window.WindowState == WindowState.Minimized)
     //    {
     //        window.WindowState = WindowState.Normal;
     //    }
     //}
 }
Ejemplo n.º 2
0
 private static void advanceBackgroundSlider()
 {
     //Display the Desktop via the COM component Shell32.dll
     Shell32.Shell objShell = new Shell32.Shell();
     objShell.ToggleDesktop();
     // Simulate Ctrl + Space to deselect anything that may be selected
     SendKeys.SendWait("^( )");
     // Simulate pressing Shift + F10 to open Desktop context menu
     SendKeys.SendWait("+{F10}");
     // Simulate pressing N to execute the “Next desktop background” command
     SendKeys.SendWait("{N}");
 }
Ejemplo n.º 3
0
        public async Task CaptureDesktopAsync(string screenshotsFolderPath, bool isCaptureDesktop)
        {
            if (isCaptureDesktop)
            {
                Shell32.Shell shell = new Shell32.Shell();
                shell.ToggleDesktop();

                await Task.Delay(200);

                String filename = screenshotsFolderPath + "\\Desktop_" + DateTime.Now.ToString("dd_MM_yyyy") + ".png";
                TakeAndSaveScreenshot(filename);
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Shows the specified window and brings it to top
 /// </summary>
 /// <param name="handle">window handle</param>
 /// <returns>true on success</returns>
 public static bool ActivateWindow(IntPtr handle)
 {
     if (IsDesktopWindow(handle))
     {
         Shell32.Shell shell = new Shell32.Shell();
         shell.ToggleDesktop();
         return true;
     }
     int style = User32Interop.GetWindowLong(handle, User32Interop.GWL_STYLE);
     if ((style & User32Interop.WS_MAXIMIZE) == User32Interop.WS_MAXIMIZE)
     {
         //It's maximized
         User32Interop.SetForegroundWindow(handle);
         User32Interop.ShowWindow(handle.ToInt32(), User32Interop.SW_SHOW);
         User32Interop.BringWindowToTop(handle);
     }
     else if ((style & User32Interop.WS_MINIMIZE) == User32Interop.WS_MINIMIZE)
     {
         //It's minimized
         User32Interop.SetForegroundWindow(handle);
         User32Interop.ShowWindow(handle.ToInt32(), User32Interop.SW_RESTORE);
         User32Interop.BringWindowToTop(handle);
     }
     else
     {
         // don't give up just yet!
         User32Interop.SetForegroundWindow(handle);
         User32Interop.ShowWindow(handle.ToInt32(), User32Interop.SW_SHOW);
         User32Interop.BringWindowToTop(handle);
     }
     return true;
 }
Ejemplo n.º 5
0
        private void toggleDesktop()
        {
            Shell32.Shell shell = new Shell32.Shell();
            shell.ToggleDesktop();

            togglingDesktopDone(this, null);
        }