- // create pens
- HPEN hpenBack = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_WINDOW)),
- hpenGray = CreatePen(PS_SOLID, 0, RGB(128, 128, 128)),
- hpenPrev = (HPEN)SelectObject(hdc, hpenBack);
-
- // we erase the 1-pixel border
- Rectangle(hdc, x, y, x + nCheckWidth, y + nCheckHeight);
-
- // shift check mark 1 pixel to the right (it looks better like this)
- x++;
+ // create pens, brushes &c
+ COLORREF colBg = ::GetSysColor(COLOR_WINDOW);
+ AutoHPEN hpenBack(colBg),
+ hpenGray(RGB(0xc0, 0xc0, 0xc0));