I would like to know if it’s possible to write a context menu extension that, upon right clicking, would open the file and look at the first few bytes, changing the resulting menu items that appear.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, it’s possible.
Context Menu Shell Extensions allow you to implement an interface which, once registered, is called by the system to determine what menu items you want to display. During the call, you could open the file, read the data and selectively choose which menu items to display.
I would advise not doing this in C# however – the IContextMenu and other interfaces are designed more for a C++ implementation.
Edit: Microsoft officially does not support writing shell extensions with managed code.