New API: SetProgressState, including sample.