Reorganized window initialization code
Added video resizing to dialog