Eliminated UI flicker problem on slow systems and implemented double buffering in WM_PAINT for UI drawing