January 8th, 2014

The case of the missing context menu verbs

A customer reported that when they right-clicked a batch file, a bunch of commands were missing. For example, Open was gone! Okay, there really isn’t much of a story here, because some direct debugging quickly identified the culprit. The customer had installed a third party shell extension which returned a huge value from its IContext­Menu::Query­Context­Menu method. Explorer told the shell extension, “Hey, like I’ve got room for 30,000 menu items. How many do you need?” The shell extension replied, “I’ll take 29,995 of them.” And so the shell extension sucked up nearly all the menu IDs, and by the time the Open command handler came along, the context menu host said, “Sorry, I’m all out.” If you followed along when we created a composite context menu, you could sort of see this problem coming.

Uninstalling the buggy shell extension fixed the problem.

Topics
Code

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.