Coding to the Windows SDK Reading properties #7 - Summary
Writing properties #1 - Simple beginnings Writing properties #2 - Filetype support? Writing properties #3 - Which properties are writable? Writing properties #4 - Which properties are writable? Writing properties #5 - Property lists Writing properties #6 - GPS_READWRITE omits read-only data sources The deal with IPropertyStoreCapabilities Writing properties #8 - Canonical Values Gotcha: You must release property stores quickly
----
Writing properties is very simple at the core: you just call SetValue() and then Commit(). But then there are a bunch of details surrounding this task that make it a little more complicated. To close this topic, I want to give one more tip:
The best way to determine if the file/filesystem/filetype itself is writable is to simply call IShellItem2::GetPropertyStore(GPS_READWRITE). This performs the necessary ACL checks, attribute checks, etc. The only downside is that the return value is non-actionable. If you want to display a more specifical error message or offer corrective options, you'll have to program those yourself.
Thus, a property editing user interface will typically do the following:
Then to save changes, it...
-Ben Karas
ps. There is an even simpler way to write properties using IFileOperation. I'll have to revisit that another time.