Created
July 6, 2016 15:26
-
-
Save kmteam/7ec0e0a9b627c659f59e87d29df27bc6 to your computer and use it in GitHub Desktop.
Use OpenFiles in Csharp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: Require files 'ListOpenedFileDrv_32.sys' and 'OpenFileFinder.dll' | |
public class OpenFiles { | |
public enum OF_TYPE { | |
FILES_ONLY = 1, | |
MODULES_ONLY = 2, | |
ALL_TYPES = 3 | |
}; | |
public struct OF_INFO_t { | |
public uint dwPID; | |
[MarshalAs(UnmanagedType.LPWStr)] | |
public String lpFile; | |
public int hFile; | |
}; | |
public delegate bool OF_CALLBACK(OF_INFO_t OpenedFileInf0, int uUserContext); | |
[DllImport("OpenFileFinder.dll")] | |
public static extern void GetOpenedFiles([In, MarshalAs(UnmanagedType.LPWStr)] string lpPath, OF_TYPE Filter, OF_CALLBACK CallBackProc, int pUserContext); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment