Backup program

So I've been having some troubles with not keeping an extra backup of files and end up losing them... I'm too lazy/forget to put them into my google drive folder/dropbox etc so I thought about making a program that'll do it for me. I want the program to check if one of the files I've set to backup is open in another process and then wait for it to close again (to assume its been opened, worked on and then saved and closed) but the problem is I have no clue how to go about checking if said file(s) are open by another process. Any ideas?

Thanks, thefatshizms.
If you try to open the file with the "CreateFile()" function with the Share Mode set to 0 and it fails the that would indicate that the file is open some where, but it would not be able to tell you what application has it open. The function "LockFileEx()" should be able to tell you when it is closed again.

EDIT: The 'dwCreationDisposition' for "CreateFile()" should be set to 'OPEN_EXISTING' obviously.
Last edited on
Topic archived. No new replies allowed.