Fix SetMenu after CreateWindow for invisible window

Michal Janusz Miroslaw M.Miroslaw at elka.pw.edu.pl
Fri Sep 19 09:23:35 CDT 2003


On Fri, Sep 19, 2003 at 11:11:30PM +0900, Dmitry Timoshkov wrote:
> "Michal Janusz Miroslaw" <M.Miroslaw at elka.pw.edu.pl> wrote:
> > +/**********************************************************************
> > + *         SetMenu    (USER32.@)
> > + */
> > +BOOL WINAPI SetMenu( HWND hWnd, HMENU hMenu )
> > +{
> > +    TRACE("(%p, %p);\n", hWnd, hMenu);
> > +
> > +    if (GetWindowLongA( hWnd, GWL_STYLE ) & WS_CHILD) return FALSE;
> 
> A better fix is to remove the above check altogether.

I tried it, but SetMenu is called from WIN_CreateWindowEx before initialising
X11DRV's structures (wndPtr->pDriverData is bogus), and it didn't work for
windows with hMenu != 0 parameter to CreateWindow*. The real fix, was to
remove 'if (IsWindowVisible(hWnd))' before SetWindowPos, but that didn't
work in the middle of CreateWindow.

  -- Michał Mirosław



More information about the wine-devel mailing list