File metadata in Win32 C runtime library

833 views Asked by At

I'm writing a Windows application in C and I'm trying to figure out how to retrieve metadata about files (specifically, it's the author information that I'm interested in). I've been up and down Microsoft's list of functions and I haven't found anything that looks like what I want.

From Google and other Stack Overflow questions, I've found that NTFS stores metadata separately from the files themselves, so I'm guessing that just opening the files and looking for the metadata probably isn't what I want.

1

There are 1 answers

4
Jonathan Potter On BEST ANSWER

The easiest way to do this is using the shell via the IShellFolder2::GetDetailsEx() API. This way you have access to any metadata the shell knows how to extract. There's an example here of using this interface to query items in the recycle bin, but the same technique applies to any folder.