Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Alter Context Menu Depending on SelectedObject

This application registers a ShellUI module that declares a command which is only available when a single object is selected and the context menu (right-click menu) opened.

This approach can be used to filter commands to only show - for example - if objects of a certain type are selected when the context menu is triggered.

Application structure

  • The application consists of two files:


The application broadly takes the following approach:

  1. When the shell frame is started, the code creates a command and adds it to the context menu.
  2. When the IShellListing.OnShowContextMenu event is fired, the system checks how many items are selected and shows or hides the command accordingly:
    • If there is only one item selected then the command is visible.
    • If there are zero items selected, or more than one item selected, the command is hidden.

Testing and deploying


The simplest method to test an application is to copy the files into a local development folder. This allows you to alter the files and simply log out and into the vault to see the changes.


To deploy the application, you must zip the application files and deploy them using the M-Files Admin tool. This process is detailed on the M-Files Developer Portal.


When a client connects a vault, new User Interface Extensibility Framework applications will be downloaded and the user will be prompted to install them. This can be avoided by pre-approving it using registry keys.

You can’t perform that action at this time.