Setup OpenWindow function