Adding a ShowDesktop Feature to Your Applications

The following code makes use of the Shell32 .Shell class to minimize all open windows, similar to what the Show Desktop button on the taskbar does. This also hides all open dialogboxes.

namespace ShowDesktop{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        private static Shell32.Shell shellInterface = new Shell32.Shell();         private void button1_Click(object sender, EventArgs e)        {            shellInterface.MinimizeAll();         }    }}
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Related Posts