Huw D M Davies h.davies1@physics.ox.ac.uk writes:
- orig_bm = SelectObject(screen_mem_dc, hbitmap);
- StretchDIBits(screen_mem_dc, 0, 0, new_width, new_height, 0, 0, width, height, bits, fix_info, DIB_RGB_COLORS, SRCCOPY);
- SelectObject(screen_mem_dc, orig_bm);
That's not thread safe, you either need a critical section around the global screen_mem_dc, or probably better simply create a mem DC local to the function.