CloseForegroundWindow us a Windows code snippet to minimize the foreground window.
#include <windows.h> //From http://www.richelbilderbeek.nl/CppCloseForegroundWindow.htm void CloseForegroundWindow() { const HWND handle = GetForegroundWindow(); CloseWindow(handle); }