locked
Programmatically setting file "detail" RRS feed

  • Question

  • When the Windows Explorer view is set to Details, one can right click on a column header and choose to display additional information such as "Label", "Tag", "File Version" or "Title". How can these be set (or read) programmatically, say in a C# program?

    This sounds like it should be simple to do.

    Thanks

    Mike
    Sunday, January 17, 2010 8:44 PM

Answers

  • Hello

    Windows API Code Pack wraps some shell functions and provide the ShellPropertyWriter class that can serve your purpose.

    http://code.msdn.microsoft.com/WindowsAPICodePack
    public void SetRating(uint rating)
    {
                    ShellPropertyWriter w = shellObjectParent.Properties.GetPropertyWriter();
                    w.WriteProperty(SystemProperties.System.Rating, rating);
                    w.Close();
    }

    Additionally, CodePack supports writing properties just by accessing the strongly typed value.

    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, January 18, 2010 8:28 AM

All replies

  • Hello

    Windows API Code Pack wraps some shell functions and provide the ShellPropertyWriter class that can serve your purpose.

    http://code.msdn.microsoft.com/WindowsAPICodePack
    public void SetRating(uint rating)
    {
                    ShellPropertyWriter w = shellObjectParent.Properties.GetPropertyWriter();
                    w.WriteProperty(SystemProperties.System.Rating, rating);
                    w.Close();
    }

    Additionally, CodePack supports writing properties just by accessing the strongly typed value.

    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, January 18, 2010 8:28 AM
  • Hi,

    I am looking for the option to add a custom property using this API.
    How could this be accomplished?

    thanks.
    Wednesday, January 6, 2016 10:01 AM