Is there a correct way to get file details in windows since GetDetailsOf column numbering changes between OS releases?

StackOverflow https://stackoverflow.com/questions/14439169

Question

We have been using Shell32 Folder.GetDetailsOf(folderItem, column) to get file details and extended file details of different files. Unfortunately this breaks between OS versions since the column numbering changes, as can be seen from this code example (no relation to our project).

I can't seem to find the correct way to get extended file details which do not break this easily, and no way to (non-hackily) find out the correct column numbering. So the question, how is this done in the correct way?

(Edit: more specifically, the information we read out is audio, video and image information such as size, fps, bitrate, and so on.)

Was it helpful?

Solution

Use FolderItem2.ExtendedProperty to get the property you want. See this answer, although that answer does it the hard way (via the fmtid). Easier is to use the canonical name, "System.Author" instead of the ugly GUID.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top