>Thanks, that was very helpful. My form now runs error free, but I dont get a polygon yet, so I'm missing something. This API stuff is pretty new to me.<g> What I've ended up with is a call to each function, as in the KB article. Any more pointers?
>
>...
>lnwhandle = _WFindTitl(This.Caption)
>lnhDC = _WhToHWnd(lnwhandle)
>llresult = Polygon(lnhDC, @Points, 3)
>PGRgn = CreatePolygonRgn(@Points, 3, 1)
>Brush = GetStockObject(4)
>FillRgn(lnhDC, PGRgn, Brush)
>*SetWindowRgn(lnhDC, PGRgn, 1)
>Deleteobject(Brush)
>RETURN
Hi Chris,
It looks like you're missing a step in the above. Try this instead, the changes are in bold
lnwhandle = _WFindTitl(This.Caption)
<b>lnhWnd</b> = _WhToHWnd(lnwhandle)
<b>lnhDC = GetDC(lnhWnd)</b>
llresult = Polygon(lnhDC, @Points, 3)
PGRgn = CreatePolygonRgn(@Points, 3, 1)
Brush = GetStockObject(4)
FillRgn(lnhDC, PGRgn, Brush)
Deleteobject(Brush)
RETURN
The declaration for GetDC is:
GetDC in Win32API INTEGER hWnd
George
Ubi caritas et amor, deus ibi est