Replaced proposed RepaintEvent with call to FlushImage on windows