Check this part of this video: https://cgcookie.com/lesson/reducing-noise-with-portals?wtime=44
In his 3D viewport you can see he extended the box out in order to capture his camera and then added a face to close the box. Once you do that the HDRI will only be able to light thru the window.