Sorry for the late response...
Basically the idea is to use it in a File Manager. I really hate that enoying Windows Message that pops up if you try and delete an empty folder (not a system folder) and it's still in use by some program...
Is there then a way to see which program is using(or locked) the file/folder? Then maby the safest way is to prompt the user to close this application before continueing?
Main Topics
Browse All Topics





by: jkrPosted on 2009-03-04 at 07:47:17ID: 23795867
Basically it is not a good idea to forcibly close a file that is in use by another application - that might cause a crash or (even worse) data loss. If your goal is to delete a file in use, I'd rather recommend to use 'MoveFileEx()' (http://msdn.microsoft.com /en-us/lib rary/aa365 240(VS.85) .aspx) with 'MOVEFILE_DELAY_UNTIL_REBO OT' to schedule the file to be deleted until the next reboot. See also http://support.microsoft.c om/kb/1405 70 ("How To Move Files That Are Currently in Use")