change window active code