I combined learnings from two different sources to detect open windows using UIAutomation and to move the windows: