>Is there a windows API call which will tell me which process has a file open?
George,
As far as I know there's no simple API call to do this. If you want a
utility that will do it, have a look at the excellent Process Explorer
tool at www.sysinternals.com
Dave

Signature
MVP VC++ FAQ: http://www.mvps.org/vcfaq
George Grimes - 19 Mar 2005 23:17 GMT
> >Is there a windows API call which will tell me which process has a file open?
>
[quoted text clipped - 5 lines]
>
> Dave
Thanks, That will get me what I need.
George
Michael Nemtsev - 22 Mar 2005 11:26 GMT
Hello David,
>> Is there a windows API call which will tell me which process has a
>> file open?
> As far as I know there's no simple API call to do this. If you want a
> utility that will do it, have a look at the excellent Process Explorer
> tool at www.sysinternals.com
It's not that hard. See explanations and examples there
http://www.codeguru.com/Cpp/W-P/system/processesmodules/article.php/c2827/
http://www.codeguru.com/Cpp/W-P/files/fileio/article.php/c1287/
David Lowndes - 22 Mar 2005 11:35 GMT
>It's not that hard.
It can't be that straightforward either when that article contains a
warning like this:
"This software uses a few undocumented functions (ntdll.dll), peeks
around in your systems internals. Use at your own risk! It works for
me".
:)
Dave
Willy Denoyette [MVP] - 22 Mar 2005 23:23 GMT
> >It's not that hard.
>
[quoted text clipped - 8 lines]
>
> Dave
Which are the same internal API's used by sysinternals Process Explorer :-)
Willy.