RECT rWindow
RECT rClient
HRGN hRgnWindow
HRGN hRgnClient
HRGN hNCRgn
Get the window and client rectangles for the window.'
GetWindowRect hWnd,rWindow
GetClientRect hWnd,rClient
Translate the Client rectangle into screen coordinates.'
{POINT pt = {0,0
MapWindowPoints hWnd,0,pt1
OffsetRect rClient,pt.x,pt.y
Create regions from these two rectangles'
(hRgnWindow=CreateRectRgnIndirect(rWindow
(hRgnClient=CreateRectRgnIndirect(rClient
(hNCRgn =CreateRectRgn(0,0,0,0
Subtract the client region from the window region'
,CombineRgn hNCRgn,hWindowRgn,
(hClientRgn,RGN_DIFF
Perform actions on the NC region'
'Free region resources
DeleteObject hRgnWindow
DeleteObject hRgnClient
DeleteObject hNCRgn