Skip to main content
added 60 characters in body
Source Link
Hornbydd
  • 44.6k
  • 5
  • 42
  • 84

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
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
Public x As myClass
    
Public Sub test()
    Set x = New myClass
    Dim pApp As IApplication
    Set pApp = Application
    
    pApp.LockCustomization "fred", x
End Sub

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

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
Source Link
Hornbydd
  • 44.6k
  • 5
  • 42
  • 84

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