0

With an extension I can block ArcMap's Customize menu using following code line:

ArcMap.Application.LockCustomization("password");

But, it makes no sense since by right-click on Toolbar docking area, user still can add any toolbar s/he wants. Is there a way to block that right click menu too?

2
  • 1
    Why would you want to stop users from accessing the other tool bars, seems a bit draconian? If a user is even aware they can access tool bars via that route it would suggest to me that they are a "power user" and would not want to be locked out of the other useful tools. If you want to limit what they can use then maybe you should be developing an Engine standalone application rather than reducing functionality in ArcMap?
    – Hornbydd
    Commented Feb 10, 2014 at 15:23
  • Well, it is to be modified according to login information. We have an extension which asks for login/password and choose functionality according to the users privileges. We have ArcEngine application too as an alternative but tender contract tells us to prepare this kind of staff.
    – shika-kun
    Commented Feb 10, 2014 at 15:35

1 Answer 1

1

Have a look at this thread, may be an issue for you depending upon which version of ArcGIS you are using.

I cobbled some code together in VBA, this may help you. I never quite got it to stop the tool bar opening but the event is captured.

myClass that implements ICustomizationFilter

Implements ICustomizationFilter

Private Function ICustomizationFilter_OnCustomizationEvent(ByVal custEventType As esriCustomizationEvent, ByVal eventCtx As Variant) As Boolean

    If custEventType = esriCEInvokeCommand Then
        Let ICustomizationFilter_OnCustomizationEvent = False
        Debug.Print eventCtx
    End If

End Function

A module setting the filter:

Public x As myClass

Public Sub test()
    Set x = New myClass
    Dim pApp As IApplication
    Set pApp = Application

    pApp.LockCustomization "fred", x
End Sub
1
  • Thanks, at least now I know that it can't be done as long as we don't move on the next version. (10.0 and 10.1 currently).
    – shika-kun
    Commented Feb 11, 2014 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.