In part 1 we understood what a context menu was and how Visual studio helps to create one at the design time and runtime level on a windows form.
In this tutorial we are going touch base on some of the key aspects of Context Menu controlled and generated by the shell explorer with the help of the demo code included with this article.
You should have observed that the context menu items change wrt to the object or context on which a right click is performed. These activities are actually controlled by Windows Shell Explorer.
The Shell Explorer is also called the file manager that is shipped with every release of Windows Operating system. It provides a graphical user interface for managing files. The process that host the Shell Explorer is the explorer.exe
Here’s a list of operations Shell Explorer is responsible for
- Render the graphics for the taskbar and the desktop
- Render the graphics for windows, folders, icons, file menu’s, toolbars
- Render the graphics for the start menu
- Render the graphics to display the tree structure of your file system, which is also called the explorer
- It provides the search engine feature for your file system
- And most important and the topic of this article – the context menu
(Try this: On your computer kill the explorer.exe process. You would observe that the task bar disappears, the desktop shows no sign of any icons. Active windows on your desktop would still be visible, minimizing the same would make them disappear.
Note that following the above step will not crash or delete data from your computer. You can bring back your desktop by launching the Task Manager, goto File->New Task, and then type explorer.)