>If you don't insist on exact colors, another possibility is to use shared pens, i.e. use ObtainBestPen.
It prefers to allocate them exclusively so that the user can adjust the colours themself (via the program's inbuilt palette editor). In the case where this isn't possible it will fall back to allocating them as shared pens (and it disables the palette editor in this case).
>You could check the depth of the screen's bitmap and if it is higher than 8 you need only one exclusive pen and use SetRGB32 to set the actual color before you draw.
Sorry, I don't understand how this would work...I allocate one pen, draw with it, change the colour via SetRGB32, draw with it...wouldn't the colour of the first pixel(s) already onscreen then be changed?