C++ programming: How does Shell Context Menu Work ? - Part 2 | CodeGuru

C++ programming: How does Shell Context Menu Work ? – Part 2

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 […]

Written By
CodeGuru Staff
CodeGuru Staff
Aug 13, 2010
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

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

  1. Render the graphics for the taskbar and the desktop
  2. Render the graphics for windows, folders, icons, file menu’s, toolbars
  3. Render the graphics for the start menu
  4. Render the graphics to display the tree structure of your file system, which is also called the explorer
  5. It provides the search engine feature for your file system
  6. 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.)

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.