views:

210

answers:

2

How to add properties to a file like the Windows Office?

In Windows, is possible to edit fields from a file like Title, Subject, Keywords etc. How to do the same with an arbitrary file from C/C++ without using Office?

Do you have any hint about API, DLLs or general tricks?

+1  A: 

This data can be stored in alternate data streams. Here are some examples of the APIs to access ADSs in NTFS.

JP Alioto
+1  A: 

There are two kinds of metadata that might be displayed. One is file based metadata, which is going to specific to NTFS, in which case you should research NTFS metadata API's. The other kind of metadata is going to be file format specific, like JPEG exif blocks, or MS Office Summary. This kind of metadata is going to require specific knowledge of every kind of file format you want to edit data for, and in the case of Microsoft Office documents, is liable to change between office versions. You're best bet for office documents would probably be to start with OOXML summary field editing and seeing if you want to continue with other formats from there.

Jherico
The problem with NTFS metadata is that as soon as the file is moved off of NTFS, its gone. It can also get deleted by files that read and write the file. Really, the metadata seems like its designed to be exploited for nefarious purposes exclusively.
Matthias Wandel