Detect a Mouse Click 

Should your mouse pointer be over a particular area of the screen and, say, the left mouse button is clicked, you can use the Gdiplus::Region 'IsVisible' method to 'hit test' your graphics objects. The example below uses this mechanism to paint the interior of a predefined region in response to such a mouse click.

if(m_pRegion->IsVisible(lXPos, lYPos))
{
Graphics* pCanvas = new Graphics(hWnd);
ULONG ulARGBColour = Color::MakeARGB(m_ucAlpha, m_ucRed, m_ucGreen, m_ucBlue);

// Paint the inside of the region
this->Fill(pCanvas, ulARGBColour);
delete pCanvas;
}

The lXPos and lYPos above are the x and y mouse coordinates, obtained from a window mouse button-click handler. The fill method in the code block above simply calls the Gdiplus::Graphics 'FillPath' method, as detailed below.

Color colorBrush(ulARGBFillColour);
SolidBrush newBrush(colorBrush);
pCanvas->FillPath(&newBrush, m_pPath);