New Application.OnInitialize. Also fixes crashed when resizing (related to progress bar in middle).