title: Detect if file is open in C++
body: <p>Is there any way in C++ to detect if a file is already open in another program?.<br>I want to delete and rewrite some files, but in case a file is opened I want to display an error message. I am using Windows OS. </p>