My project takes a bitmap snapshot of the client area of a given window, and converts this data into an `IplImage` instance. Then after a grayscale conversion, threshing etc, bounding boxes are drawn around any contours which exceed a given minimum size (area volume).  

The result is then shown within a `cvNamedWindow`

All I need to do now is allow the user to click within these rects to effectively "choose" this contour, so that the application can then extract the subrect as a new image and save it to disk.

How can this be achieved using OpenCV in C++?