I have seen lot of examples in opencv exampes to Exit a window by pressing "ESC" key. I am working in a windows platform where I need to use the close button in the window to close the opencv "Capture" window? How can I do it? Any suggestions and examples will be helpful.