You could then use ScreenToClient(rect) which converts the rectangle to the windows client coordinates.