-
-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid SelectedItem Count with > 16 items #4
Comments
I have just tested and confirmed this behaviour on Windows 8 - with IShellExtInit we don't get more than 16 items, seems to be an optimisation in windows. |
More details: http://msdn.microsoft.com/en-us/library/dd758093%28VS.85%29.aspx[^] In Windows 7 and later, the number of items passed to a verb is limited to 16 when a shortcut menu is queried. The verb is then re-created and re-initialized with the full selection when that verb is invoked. |
Hello, sorry, but reading the above I don't understand if it is currently possible with SharpShell to receive more than 16 files in a context menu. Please help. |
It is possible, the only problem is that you only see 16 items when the verb is queried - once it verb is actually invoked you get the full set of items |
Dave, thanks for the response. Unfortunately, in my tests, if there are more than 16 items selected in explorer, the click event handler is not called at all. var tagItem = new ToolStripMenuItem { Text = stringaTag, Image = Icons.tag_16x16 }; it works properly if you select fewer items. Any suggestions? Thanks again. |
Hi @seguso at the moment I'm flat out of suggestions, this has been an extremely problematic issue to fix, you could try looking at the links mentioned earlier in this thread and see if anything suggests itself to you. I'll try and build a test case around this soon but that will mean only that I can reproduce the problem more easily, not that I can necessarily fix it |
A little bit of a necro-post, but take a look at this article. |
Thanks @Miki101! Some notes from my own recent investigation. When running the 'Count Lines' sample on Windows 10, the handler is shown: The handler is also called successfully with the correct set of files: This is without:
set. However, I'm going to update the docs with the links to this article and the associated issue on MSDN before I close this. Thanks for letting me know @Miki101 ! |
Updated the old CodePlex docs to markdown, added a note on limitations with Context Menus when working with more than 15 items. Closes #4.
In the recent post I made as issue #353, I have cited what appears to me to be the very same problem as seguso mentioned back in Oct 2014. When I write my code to construct a collection of submenu items, I do get the onclick event, whereas seguso indicated that he never gets the call to his event handler. Sadly, when I get the call to my event handler it is the wrong submenu item! My nested menu is a hierarchy of folders that has hundreds of menu items. I choose a submenu which happens to be item 192 and the callback is sent to the event handler for submenu item number 10. It ends up looking to the end user like they clicked on the wrong menu item. I can see that my code is invoked with 16 items on right mouse click and then my code is invoked with 20 items upon mouse click. There is actually no problem for me on that account. My issue is that the calling code (sharp shell) is telling me that someone clicked menu item number 10 when the user actually clicked item number 192. Can I get some help with this particular point either here or in issue #353? |
See: http://www.codeproject.com/Articles/512956/NET-Shell-Extensions-Shell-Context-Menus?msg=4710563#xx4710563xx
Hey,
when I'm right-clicking on more than 16 selected files and/or directories for the first time, my context menu handler don't show up on each file/directory as I'd expect. I found out that this happens because at the very beginning the selectedItem count is somehow set to 16, although I have selected a lot more than 16 files and/or directories. But when I click on the handler of one of the file/directory which shows the menu, the selectedItem count is set to the real number of elements I have selected.
Do you have any suggestion why this happens or what I could do to avoid this behaviour?
Thanks!!
The text was updated successfully, but these errors were encountered: