代码CBrush*pBrhOld,BrhNew; pPenOld=(CPen*)dc.SelectStockObject(BLACK_PEN); pBrhOld=(CBrush*)dc.SelectStockObject(GRAY_BRUSH); dc.Rectangle(100,100,300,300); PenNew.CreateStockObject(NULL_PEN);