Search code examples
winapirenameshell-extensions

Renaming in my NSE does not work in Content View


NSE meaning namesapce extension (https://msdn.microsoft.com/en-us/library/windows/desktop/cc144095%28v=vs.85%29.aspx)

I have a namespace extension developed using the DefView.

I am handling FMTID_PropList+PID_PropList_ContentViewModeForBrowse and returning the correct proplist-string.

When I browse my nse in "Content View" in Windows Explorer, renaming does not work.

Additionally, I notice that Windows Explorer prefixes the value of my first column (which is the item name) with "Name: - it does not do this for items in the filesystem.

How can I solve both the above issues?

I copied the question from:

https://social.msdn.microsoft.com/Forums/en-US/a88ca56d-542e-46a8-81b4-7c37431ea26a/renaming-in-my-nse-does-not-work-in-content-view?forum=windowsuidevelopment

I'm having the exact same issue and could not find any help on the web.


Solution

  • You are using obsolete format of proplist string. It was actual in Windows XP era. Starting from Windows Vista it is necessary to use new format. Instead of GUID and PID you must use canonical name of property key. That why Windows does not allow user to rename your object in content view mode.

    {b725f130-47ef-101a-a5f1-02608c9eebac} 10 is equal to PKEY_ItemNameDisplay with canonical name System.ItemNameDisplay.

    "~" char before canonical name has a special meaning. If it does not present shell shows label before value. In case of System.ItemNameDisplay label is "Name".