Basic window handling and program flow