BOOL bSuccess = FALSE; HRGN hrgn = CreateRectRgn(0,0,1,1); // create a generic rgn if ( GetClipRgn(hdc, hrgn) != -1 ) // get the clip rgn from the given hdc { if ( OffsetRgn(hrgn, xDiff, yDiff) != ERROR ) // offset the clip rgn { if ( SelectClipRgn(hdc, hrgn) != ERROR ) // select the modified rgn into bSuccess = TRUE; // the device context } } DeleteObject(hrgn); // delete the rgn we created above