Repaint a system Editor window

How can a system Editor window like Build Settings be forced to repaint?

An internal system window can be repainted like this (Build Settings case, change the GetType string to repaint some other window):

var buildSettingsType = System.Type.GetType("UnityEditor.BuildPlayerWindow,UnityEditor");
var windows = Resources.FindObjectsOfTypeAll(buildSettingsType);
if (windows != null && windows.Length > 0)
{
    var window = (EditorWindow)windows[0];
    if (window)
        window.Repaint();
}