Contextmenu Shell Extension problem
-
Hi everyone. I'm currently working on a larger system that will incorporate several tools including shell extensions. The contextmenu works fine for when I rightclick single files. All menuitems show, and InvokeCommand is called to do the work assosiated with the menuitem clicked. But if I select several files, the contextmenu shows, the submenuitems shows and are selectable, but nothing happends. I got a debugger in InvokeCommand() so I know it isn't called. Seems to me that there's some kind of pointer / reference mismatch so that explorer isn't firing my InvokeCommand method. If anyone has some experience in contextmenu shell extensions I'd appreciate some feed back. I'll gladly post some code too if it helps. -Larantz-
-
Hi everyone. I'm currently working on a larger system that will incorporate several tools including shell extensions. The contextmenu works fine for when I rightclick single files. All menuitems show, and InvokeCommand is called to do the work assosiated with the menuitem clicked. But if I select several files, the contextmenu shows, the submenuitems shows and are selectable, but nothing happends. I got a debugger in InvokeCommand() so I know it isn't called. Seems to me that there's some kind of pointer / reference mismatch so that explorer isn't firing my InvokeCommand method. If anyone has some experience in contextmenu shell extensions I'd appreciate some feed back. I'll gladly post some code too if it helps. -Larantz-
Solved it. I'll post the solution incase anyone else runs into the same problem. My extension is made up with dynamic contextmenus that vary in size and content according to the filetype etc. So I had identifier baseIDs like i.e: baseIDTxt 0, baseIDDoc 100, baseIDRtf 200; These baseIDs are then used when creating/populating the menus so it's easier to locate the correct commands when InvokeCommand is called. I'd just switch on the baseids: case baseIDTxt + 0: //menuitem index 0 //do something to txt file break; case baseIDTxt + 1: //menuitem index 1 //do something else to txt file break; The problem for me was that if I used a baseID larger then 100 for some of my menus, and the InvokeCommand for that specific contextmenu wouldn't show. So try and keep them below 100 and you should be fine. I now have a dynamic contextmenu with dynamic number of sumbmenuitems that varies for 4 filecases. I used four bases i.e: baseX = 0, baseY = 25, baseZ = 75 and baseLast = 100; -Larantz-