For me (Gnome 3.22) worked:
gsettings set org.gnome.desktop.wm.preferences button-layout 'appmenu:minimize,maximize,close'
together with
gsettings set org.gnome.shell.extensions.classic-overrides button-layout 'appmenu:minimize,maximize,close'
Following elsewhere given answer doesn't work anymore: gsettings set org.gnome.shell.overrides button-layout close,minimize,maximize:
You can do that using Windows themes, with which you may customize just about every aspect of Windows.
However, this is a complex subject, and creating themes as XML files is not for everyone, so using a third-party product is recommended.
Perhaps the best product in that area is Stardock WindowBlinds, which is however trialware (although not very costly).
On RHEL 5 / CentOS 5, the red boxes went away when I changed VNC's color depth to 24-bit. For example, with the standard VNC server:
vncserver :10 -geometry 1280x960 -depth 24