Remember when using GDI objects (pens, brushes, DC ect) that they are special memory. If you do not free the memory it will crash your PC.
If you 'Get' an object 'Release' it.
If you 'Create' an object 'Delete' it.
Always catch the returned GDI object from SelectObject() to replace them later.
#define BLACK RGB(0,0,0)
#define WHITE RGB(255,255,255)
hdc=GetDC(hWnd);// get the DC to draw on and create the objects to draw with
hOriginalPen=(HPEN)SelectObject(hdc,hPen);//catch the pen already in the DC
//do the drawing
//clean up by putting the DC back the way we got it
//then delete the pen
//the brush was not in a DC so can just delete
//the DC was 'Get'ed so 'Release' it