[PATCH] user32: GetMenuItemRect works without draw if the menu isn't a popup

Andy Clayton q3aiml at gmail.com
Mon Aug 1 12:39:56 CDT 2011


On Aug 1, 2011 10:25 AM, "Alexandre Julliard" <julliard at winehq.org> wrote:
>
> Andy Clayton <q3aiml at gmail.com> writes:
>
> > +     itemMenu = MENU_GetMenu(hMenu);
> > +     if (itemMenu == NULL)
> > +         return FALSE;
> > +
> > +     if ((itemMenu->Height == 0 || itemMenu->Width == 0) &&
itemMenu->wFlags ^ MF_POPUP)
>
> That flag test doesn't make sense. What are you trying to check here?
>

I am trying to check is if it is a menu bar, because in that case
GetMenuItemRect works so long as the menu is attached to a window (according
to MSDN, anyways). Is there a better way I should be checking this? I guess
I overlooked MF_SYSMENU. I also now see that I should instead be calling
MenuBarCalcSize, and that my testing has found it returning values even if
not attached via SetMenu, though maybe they are not meaningful. Clearly I
need to take a second look at this.

Sorry for so many mistakes.

Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20110801/6a609910/attachment.htm>


More information about the wine-devel mailing list