Is it as simple as:
CreateRectRgn(yourLeft, yourTop, yourRight, yourBottom)
and set it to the window by
SetWindowRgn(Handle, RGN, true)