If your creating a windows application you can add something like this:
RECT rc;
HDC hdc=GetDC( Your window handle(HWND) );
rc.left= (X coordinate of top left corner)
rc.top= (Y coordinate of top left corner)
rc.right= (X coordinate of bottom right corner)
rc.botton= (Y coordinate of bottom right corner)
FillRect(hdc,&rc,
CreateSolidBrush((Red amount),
(Green amount),(Blue amount));
Example:
RECT rc;
HDC hdc=GetDC(hwnd);
rc.left=5;
rc.top=5;
rc.right=20;
rc.bottom=20;
FillRect(hdc,&rc,
CreateSolidBrush(0,0,255);
This will create a filled area in a form of a rectangle you can also do this do create a rectangle with it's outline drawn by the current pen in the hdc and filled the current brush in the hdc:
HDC hdc=GetDC( Window handle );
HPEN pen;
HBRUSH brush;
pen=CreatePen((PenStyle),(PenWidth),(Color));
brush=CreateSolidBrush((Color));
SelectObject(hdc,pen);
SelectObject(hdc,brush);
Rectangle(hdc,(Top left X coordinate),(Top left Y coordinate),(Bottom right X coordinate),(Bottom right Y coordinate));
Example:
HDC hdc=GetDC(Hwnd);
HPEN pen;
HBRUSH brush;
pen=CreatePen(PS_SOLID,1,
RGB(0,255,0));
brush=CreateSolidBrush(
RGB(0,0,255));
SelectObject(hdc,pen);
SelectObject(hdc,brush);
Rectangle(hdc,5,5,10,10);
This would create a rectangle that has an green outline and blue fill.
Other pen styles include PS_DASH,PS_DOT,PS_DASHDOT,
PS_DASHDOTDOT,and PS_NULL.
There are also more than one function for creating a brush which allow different effects when being used to
draw something which include
CreateHatchBrush(HatchStyle,
color); which creates a pattern and
CreatePatternBrush(Bitmap handle(HBITMAP));
which creates a pattern using a 8x8 bitmap.
Hatch styles include HS_BDIAGONAL,HS_CROSS,
HS_DIAGCROSS,HS_FDIAGONAL,
HS_HORIZONTAL,HS_VERTICAL.