menu: Fix for menu tracking problem version 2

Andrew de Quincey adq_dvb at lidskialf.net
Thu Dec 11 13:58:57 CST 2003


On Thursday 11 December 2003 19:48, Andrew de Quincey wrote:
> On Saturday 06 December 2003 19:46, Alexandre Julliard wrote:
> > Andrew de Quincey <adq_dvb at lidskialf.net> writes:
> > > I wrote a program in windows which had owner drawn menu items. Whenever
> > > I received the WM_DRAWITEM message:
> > >
> > > 1) I called GetCapture(), and compared it with the hwnd of main window
> > > containing the menu. It pops up a message box if they are different.
> > > 2) I then called SetCapture() with the HWND of the menu item itself.
> > >
> > > This approximately simulates what IDA is doing.
> > >
> > > The message box never popped up. This shows that even though the
> > > capture was changed in one WM_DRAWITEM, windows had reset the capture
> > > to the window containing the menu by the time of the next one. I also
> > > checked the messages _were_ being sent using Spy++ (in case of a
> > > programming error).
> >
> > That's a good start, but it's not enough to know what Windows is
> > really doing. You should also check the capture window right after you
> > call SetCapture; and you should use GetGUIThreadInfo and print out all
> > the details, especially the GUI_INMENUMODE flag. My suspicion is that
> > the capture is not allowed to change at all in menu mode.
>
> Hi, I see where you're going with this... I added your suggestion into the
> WM_DRAWITEM message handler.
>
> Yes, calling SetCapture() doesn't actually result in a change... (I called
> GetCapture() immediately afterwards)
>
> Yes, GUITHREADINFO.wFlags DID have GUI_INMENUMODE during in the above.
>
> I'll have a poke about in the SetCapture/GetCapture code... also I'll see
> if GUI_INMENUMODE is being changed by the current menu code.

Do you think such a thing should be implemented in wineserver or in the user32 
DLL? To me, it would go in wineserver 'cos it has all the information 
available in one place... plus (to me) its kind of a hard constraint that 
should be implemented in the wineserver logic.



More information about the wine-devel mailing list