Hello everyone,
On Windows platform, which API could be used to check whether a file is opened (either by other thread or process or even the same thread) or not?
C++ is fine.
thanks in advance,
George
Hello everyone,
On Windows platform, which API could be used to check whether a file is opened (either by other thread or process or even the same thread) or not?
C++ is fine.
thanks in advance,
George
You can try to open the file with "NO sharing", then it will fail if some other process has the file open.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
when you say a file do you mean a process or what , because your making it sound like a .txt file
and to check if its open ?
i would check if the process notepad is open then use FindWindow to check is the string of the windowtext is matching your textfile description