using-brushes
case WM_LBUTTONDOWN
Store the mouse coordinates in a POINT structure'
ptlHit=MAKEPOINTS((POINTS FAR *)lParam
Create a rectangular region with dimensions and'
coordinates that correspond to those of the grid
window
,hrgnCell=CreateRectRgn(rctGrid.left, rctGrid.top
(rctGrid.right, rctGrid.bottom
Retrieve a window DC for the grid window'
(hdc=GetWindowDC(hwndGrid
Select the region into the DC'
(SelectObject(hdc, hrgnCell
Test for a button click in the grid-window rectangle'
if (PtInRegion(hrgnCell, ptlHit.x, ptlHit.y)) Then