Remove some cwin->mainwinodow uses.