[Bug 3095] ID Collisions in menus
Ann & Jason Edmeades
us at edmeades.me.uk
Tue Dec 27 07:29:44 CST 2005
I've found my changes for this other bug, which also relates to the menu
code are wrong, and am trying to work out how to identify how windows does
The problem is that there is a menu item with the same id as a popup menu.
In all the tests for all the calling functions, windows will return the menu
item rather than the popup when the bycommand options are used. I assumed
this meant that popups weren't returned, but that is wrong.
If there is no conflict then the functions will return the popup itself even
if called by id, so I am trying to work out exactly what search algorithm
windows uses via tests.
Currently my added tests are:
1. Menu with menuitem id A, get info via id A obviously gives the menuitem
2. Menu containing empty submenu with hmenu (and hence id) of B, getinfo via
id B gives the menuitem (ie popups can be returned)
3. Menu containing submenu with hmenu (and hence id) of B which in turn
contains 2 menu items, both with id of B. Getinfo on id B gives the first of
the two items.
I wondered if this meant it searched the submenu for items before possibly
returning the submenu itself, but...
4. Menu containing submenus with ids of A and B. The second submenu (with id
B) contains 2 items with ids of A, Getinfo on id A gives the first of the
two items which come from the second submenu.
Ie windows has searched the first menu and found no items (even though the
first submenu itself is a match), then searched the second submenu and found
Are there any other testcases you think I could add which might shed light
onto how windows does it?
Given my test results, my current thoughts are to change the algorithm to
search for an item but remembering the first matching submenu. If we get to
the end of the search with no menuitem hits, but did find a submenu on the
way, return that.
More information about the wine-devel