Hi Tobias ,
On Wednesday 22 June 2005 05:34, Tobias Burnus wrote:
Ok, I re-added the out-commented/removed items and check now for uFlags & SFGAO_CANLINK and uFlags & SFGAO_HASPROPSHEET. I have the feeling no one sets this to uFlags (or to any other variable, if this is the wrong variable to check) and no one cares about the return value, but here it is.
That's not what I meant to say. The IContextMenu belongs to a shell folder object (given by the pSFParent member of ItemCmImpl). You should query this shell folder for what it supports via it's GetAttributesOf method (The flags' SFGAO prefix is an abbreviation for ShellFolder::GetAttributesOf). As far as I understand the MSDN documentation, with the CMF_CANRENAME flag in IContextMenu::QueryContextMenu the application tells the context menu if it wants the "Rename" option to be shown. So you should display the "Rename" option iff CMF_CANRENAME is set in uFlags and pSFParent->GetAttributesOf returns the SFGAO_CANRENAME flag.
All I've said so far are assumptions, based on MSDN an my own understanding of the topic. Both have proven to be incorrect often, so you probably should write some unit tests to figure out the correct behaviour on windows.
Bye,