Consider moving this into a separate function, like SetWindowProperties