Need ProgID for context menu properties command

1889
5
09-27-2011 07:10 AM
SteveCole
Frequent Contributor
This doesn't seem to be in the list of ProgIDs in the SDK help. I need to add the "Properties" command  into an add-in I'm developing. In Arcmap, it's found on the context menu when you right-click on a selected graphic element.

Anyone know the ProgID or the CLSID for it?

Thanks!
Steve
0 Kudos
5 Replies
GregRieck
Occasional Contributor III
Hi Steve,

I believe this is the CLSID you are looking for.

{BD43551C-5313-11D2-87B8-0000F8751720}

Here is how you find it.
In ArcMap go to Customize > Customize Mode
When the Customize window opens on the Toolbars tab place a check in the Context Menus box.
A Context Menu opens, click on the drop down icon
Here's the fun part - find the context menu you are looking for matching it up exactly. In this case "Element Context Menu". Once you have that name open RegEdit and search for the name you just found.
I know you are looking for the "Properties" menu, that should be a subtype off of the CLSID you find.

TIP: Capture a screen shot of the Context Menu you are looking for so you can make sure you have the correct menu.

Good Luck,

NOTE: If you don't find the context menu you are looking for in the list of Context Menus then it means that the context menu is not customizable.
G
0 Kudos
SteveCole
Frequent Contributor
Well I would have never thought to do this so thanks for the tip. The CLSID you provided does work but it displays the entire context menu, not the individual Properties command on it. I searched the Registry as you suggested and finally found the CLSID:

{92D490B7-DF9D-11D1-8779-0000F8751720}

Tried it out and it works. Thanks again!

Steve
0 Kudos
MichaelRobb
Occasional Contributor III
Interesting alternative Grieck

I never found a list so I do this: simply write a couple lines of code to GET the CLSID based on any Namespace, Class.

For example: AccessWorkspaceFactoryClass


        Dim objFactory As ESRI.ArcGIS.Framework.IObjectFactory = TryCast(m_application, ESRI.ArcGIS.Framework.IObjectFactory)
        Dim AccessWkspFactType As Type = GetType(ESRI.ArcGIS.DataSourcesGDB.AccessWorkspaceFactoryClass)
        Dim typeClsID As String = AccessWkspFactType.GUID.ToString("B")
        Dim workspaceFactory As ESRI.ArcGIS.Geodatabase.IWorkspaceFactory = DirectCast(objFactory.Create(typeClsID), ESRI.ArcGIS.Geodatabase.IWorkspaceFactory)
0 Kudos
GregRieck
Occasional Contributor III
Hi Mike,

My response is based on the same issue I had finding a GUID. Please see Customize Context Menus?. Where John Hauck (ESRI) explained that the only context menus that can be customized are the ones that appear in the list. Following John's approach I have been very successful in customizing many of the context menus.

However, I do like your programmatic approach it just lacks the verification of customization as explained by John.

G
0 Kudos
MichaelRobb
Occasional Contributor III
Thank you Griek, this is very helpful and John Hauck's approach makes more sense than pro grammatically determining GUID/ CLSID without validation. I myself will start to use this approach.
I had removed the post prior as I wanted to look into this further, but you had beat me to the punch of responding.

(So for anyone else reading this) I had briefly posted explaining ways of gathering the GUID clsID through namespace classnames)
0 Kudos