How to prevent extension activation in Extension menu (force box unchecked)

Discussion created by sebbousquet on Apr 10, 2011
ArcMap 9.3.1, C#

Implementing the IExtensionConfig interface and overriding the State property, we are able to tell ArcMap that our extension is not allowed (returning esriExtensionState.esriESDisabled value).

But in that case, in ArcMap UI, the extensio checkbox is still checked even if the extension is marked as disabled. If we close the extension menu and reopen it, then our extension is not checked as expected.

Even if we force our extension to always disabled (see sample code) this does not prevent our extension to get checked at least in the UI.

How can we prevent the extension to be checked at first right after user click on the extension?

Thank you for your help.

        public esriExtensionState State
            { return m_enableState;}

            { m_enableState = esriExtensionState.esriESDisabled;}