msgWindow: Manipulate a Window
Description
  msgWindow sends a message to manipulate the specified screen
  device's window.  With argument which = -1 it applies to the GUI
  console (which only accepts the first three actions).
Usage
msgWindow(type = c("minimize", "restore", "maximize", "hide", "recordOn", "recordOff"), which = dev.cur())
Arguments
which
a device number, or -1.