to write directly to a screen on a CGA Video card (what it does the laugh of the AMIGA coders)Here the memory you will use with Box() is the one that the native drawing code library needs.
The device context is volatile. Without talking about the default color argument in a CreateImage(i, w, h, defaultColor )...