Added extra parameter to watchWindows to allow different window types to be watched.