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

1

1

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.)

Eulogistic answered 21/1, 2013 at 12:57 Comment(0)
A
3

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.

Apiarist answered 22/1, 2013 at 14:43 Comment(2)
Is there somewhere listing the canonical names?Cd
msdn.microsoft.com/en-us/library/windows/desktop/… This is a listing of the names for common properties on media types in case anyone else is looking :)Cd

© 2022 - 2024 — McMap. All rights reserved.