CWnd::SetWindowRgn
Visual Studio 2010
Call this member function to set a window's region.
int SetWindowRgn( HRGN hRgn, BOOL bRedraw );
The coordinates of a window's window region are relative to the upper-left corner of the window, not the client area of the window.
After a successful call to SetWindowRgn, the operating system owns the region specified by the region handle hRgn. The operating system does not make a copy of the region, so do not make any further function calls with this region handle, and do not close this region handle.