I would scrape the loose paint off, then hand sand (120-150 grit sandpaper) the rest of the paint and window frame (being careful not to sand/scratch the glass. After the sanding, clean the dust off, then paint the window with a quality primer. Wait 24 hours and then paint your windows with a finish...