The following example shows how an application can retrieve the current device context brush color by using the SetDCBrushColor and the GetDCBrushColor functions.
SelectObject(hdc,GetStockObject(DC_BRUSH);
SetDCBrushColor(hdc, RGB(00,0xff;00);
PatBlt(0,0,200,200,PATCOPY)
SetDCBrushColor(hdc,RGB(00,00,0xff);
PatBlt(0,0,200,200,PATCOPY);