I created a complex region using createroundrectrgn and createpolygonrgn and then used combinergn to merge the two regions. Now I want to SetWindowRgn but it keeps returning 0.

I know that regions can be complicated, I might just be missing something.

Here is my Function....

Function CreateWindow() As Long
Dim RoundRgn As Long, PolyRgn As Long
Dim CombRgn As Long, NullRgn As Long
Dim Vertices(2) As POINT_TYPE
RoundRgn = CreateRoundRectRgn(20, 20, 150, 150, 10, 10)
Vertices(0).x = 45: Vertices(0).y = 150
Vertices(1).x = 85: Vertices(1).y = 150
Vertices(2).x = 200: Vertices(2).y = 200
PolyRgn = CreatePolygonRgn(Vertices(0), 3, WINDING)
NullRgn = CreateRectRgn(0, 0, 0, 0)
CombRgn = CombineRgn(NullRgn, RoundRgn, PolyRgn, RGN_AND)
CreateWindow = SetWindowRgn(Form1.hWnd, CombRgn, True)
DeleteObject RoundRgn
DeleteObject PolyRgn
DeleteObject CombRgn
DeleteObject NullRgn
End Function

Any ideas?