On Tuesday 21 June 2005 03:11, Tobias Burnus wrote:
Well, I actually don't know what is supposed to be there; I saw quite different menus on the different Windows versions. Some seem to have the "Properties" and "Create Link" (and other stuff more) and others have not. I will now now blindly assume that that what is in the .c file is the right thing (TM) and will delete the rest.
I guess the "Properties" and "Create Link" entries will appear in the context menus, iff the corresponding IShellFolder sets the SFGAO_HASPROPSHEET and SFGAO_CANLINK flags in it's GetAttributesOf method. For example, you can't create a link on MyComputer, but you can on Desktop.
Bye,
Hello,
Michael Jung wrote:
On Tuesday 21 June 2005 03:11, Tobias Burnus wrote:
Well, I actually don't know what is supposed to be there; I saw quite different menus on the different Windows versions. Some seem to have the "Properties" and "Create Link" (and other stuff more) and others have not. I will now now blindly assume that that what is in the .c file is the right thing (TM) and will delete the rest.
I guess the "Properties" and "Create Link" entries will appear in the context menus, iff the corresponding IShellFolder sets the SFGAO_HASPROPSHEET and SFGAO_CANLINK flags in it's GetAttributesOf method. For example, you can't create a link on MyComputer, but you can on Desktop.
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.
Tobias
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,