title: How to detect a directory is in use on Win32?
body: <p>I need a programmatic way to know if a directory (as opposed to a file) is in use, for example because it is open on explorer or a CMD prompt. If the directory is in use, then it cannot be deleted. The current way I have found to do that is trying to rename it, is there a less intrusive way to do this under Windows?</p>