In effetti agire su init come dice Franco è più lineare che non "stoppare" il gestore delle finestre come ti ho indicato io.