Using MS Windows, deleting a file sometimes does not work since "file xyz.abc is used by another process" message appears. Sometimes the message tells me which process is holding the handle, mostly it does not.
So I'm wondering if it is possible to get all PIDs/Handles that are "locking" this file I want to delete.
I already found a WinAPI function that tells me the process name of a handle. What I need is a function, that tells me the PIDs/Handles assigned to a file.
It would be glad if you could provide some code (in C/C++ or any .NET language)
Thanks in advance!