I saw this C++ code on a forum which minimizes all open windows
#define MIN_ALL 419
#define MIN_ALL_UNDO 416
int main(int argc, char* argv[])
{
A similar result can be achieved by sending these keyboard events to bring the Taskbar popup menu and send it the letter "M":
public class DesktopHelper
{
[DllImport("user32.dll")]
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, int dwExtraInfo);
///
/// Shows the desktop.
///
public static void ShowDesktop()
{
keybd_event(0x5B, 0, 0, 0);
keybd_event(0x4D, 0, 0, 0);
keybd_event(0x5B, 0, 0x2, 0);
}
}