I am developing screenshot and screen recording apps …
Use Quartz Window Services.
I want to … determine the bounding rectangle of the window, and then use the coordinates of the window to capture a bitmap of that area of the screen …
Definitely use Quartz Window Services.
Incidentally, one of its features is that you can capture a window in isolation, without anything that may be in front of it or behind it. You don't need to get its rectangle when doing this.
… and save it to a file …
Use CGImageDestination.
… or encode it into a video stream.
That part I'm not sure about. The sample code on the matter (which, as its name says, uses OpenGL for the actual capturing) uses the 32-bit-only QuickTime C API, not the 64-bit-compatible QuickTime Kit, to write the movie.