Direct Query Functions
These functions need no special setup and can be called at any time (any time it is safe to call other Windows functions)
DWORD GetWindowRegionData(HDC hwnd, DWORD size, RGNDATA FAR *prd)
RETURNS
Returns the visible area of a window as a RGNDATA structure. The coordinates returned are always in screen coordinates. If the passed buffer is not big enough to hold the RGNDATA (or it is NULL) the return value will be the buffer size required. See also: Win32 GetRegionData
DWORD GetDCRegionData(HWND hdc, DWORD size, RGNDATA FAR *prd)
RETURNS
Returns the visible area of a DC as a RGNDATA structure. The coordinates returned are always in screen coordinates. If the passed buffer is not big enough to hold the RGNDATA (or it is NULL) the return value will be the buffer size required. See also: Win32 GetRegionData and GetWindowRegionData.