ForceWindowMode script function