Discussion:
Programatically renaming folders in a NSE
(too old to reply)
AndreiRV
2010-12-14 17:28:59 UTC
Permalink
Hi,

my NSE has some folders that shows the number of items inside. That
is, the name of the folder, and also its PIDL contains the number of
items, for example MyFolder(10).
The case is: the user displays the folder's content, and deletes an
item. In this case, the folder's name should be changed to
MyFolder(9).
I compute the new folder PIDL, update it inside my IShellFolder
implementation, and call SHChangeNotify(SHCNE_RENAMEFOLDER).
First problem: the tree view, folder view and address bar are
successfully updated. But the title bar still shows the old name.
Second problem: if, after that, the user deletes another item, the
system calls my IShellFolder::BindToObject(IID_IShellFolder)
implementation still with the old PIDL (MyFolder(10)). I noticed also
GetAttributesOf with SFGAO_VALIDATE is called with the old PIDL (and I
return HRESULT_FROM_WIN32(ERROR_DIRECTORY)).
As a result of BindToObject being called with the old PIDL, my NSE
thinks that the old name is still MyFolder(10) and tries to change the
name to MyFolder(9), instead of changing MyFolder(9) to MyFolder(8).
How can I stop Explorer calling BindToObject with the old PIDL ? Why
that happens even though I don't validate the item ?

Regards,
Andrei
AndreiRV
2010-12-15 08:49:24 UTC
Permalink
Hi,

The problem is partly solved. There was a bug in generating the new
PIDL.
So, the only problem remaining is: I rename a folder inside my NSE and
call SHChangeNotify(SHCNE_RENAMEFOLDER). As a result, the tree view,
folder view and adress bar are successfully updated, but the title bar
still shows the old name.
That happens on Windows7 x64, didn't test yet on another system.

Loading...