Coder Social home page Coder Social logo

Comments (9)

dwmkerr avatar dwmkerr commented on August 18, 2024

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.

from sharpshell.

dwmkerr avatar dwmkerr commented on August 18, 2024

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.

See: http://www.codeproject.com/Articles/512956/NET-Shell-Extensions-Shell-Context-Menus?msg=4783716#xx4783716xx

from sharpshell.

seguso avatar seguso commented on August 18, 2024

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.

from sharpshell.

dwmkerr avatar dwmkerr commented on August 18, 2024

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

from sharpshell.

seguso avatar seguso commented on August 18, 2024

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 };
tagItem.Click += (sender, e) =>
{
log("debug"); // NEVER GETS HERE if there are more than 16 items selected
};
menu.Items.Add(tagItem);

it works properly if you select fewer items.

Any suggestions? Thanks again.

from sharpshell.

dwmkerr avatar dwmkerr commented on August 18, 2024

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

from sharpshell.

Miki101 avatar Miki101 commented on August 18, 2024

A little bit of a necro-post, but take a look at this article.
https://www.sevenforums.com/tutorials/131470-context-menu-items-missing-fix-when-more-than-15-files-selected.html

from sharpshell.

dwmkerr avatar dwmkerr commented on August 18, 2024

Thanks @Miki101! Some notes from my own recent investigation. When running the 'Count Lines' sample on Windows 10, the handler is shown:

image

The handler is also called successfully with the correct set of files:

image

This is without:

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MultipleInvokePromptMinimum

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 !

from sharpshell.

jleveille1337 avatar jleveille1337 commented on August 18, 2024

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 };
tagItem.Click += (sender, e) =>
{
log("debug"); // NEVER GETS HERE if there are more than 16 items selected
};
menu.Items.Add(tagItem);

it works properly if you select fewer items.

Any suggestions? Thanks again.

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?

from sharpshell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.