Adopted from Fill an ellipse in C ++ :
An ellipse is described with the current pen and filled with the current brush .
Therefore, you need to set a transparent brush. To do this, use GetStockObject(HOLLOW_BRUSH)to obtain it and SelectObject()to activate it for a given device context. So your code could be like this:
case WM_PAINT:
{
hdc = BeginPaint(hwnd, &ps);
SelectObject(hdc, GetStockObject(HOLLOW_BRUSH));
Ellipse(hdc, 0,0,500,500);
EndPaint(hwnd, &ps);
break;
}
source
share