http://bugs.winehq.org/show_bug.cgi?id=1486
------- Additional Comments From hallo@michael-kaufmann.ch 2004-05-09 10:25 ------- I've hunted this bug for many hours and now I've squeezed it :-)
The cause of this bug is that Delphi calls DestroyMenu while the menu is still visible. If you change a property of a TMenuItem (e.g. "Visible"), Delphi rebuilds the whole menu. And it destroys the old one while it is still visible. This is also a Delphi bug, because it's not documented what should happen in this situation.
Windows 9x destroys the menu immediately and sets the window's menu handle to NULL. Windows 2000 destroys the menu as soon as it's not used anymore. WINE destroyed the menu, but didn't tell that to the window showing the menu.
It was very hard to find this bug, because WINE gave the new menu the same menu handle as the old one. Delphi then thought that there was still a menu there, and didn't call SetMenu. Because of this, the menu was not initialized properly.
I've submitted a patch: http://www.winehq.com/hypermail/wine-patches/2004/09/0074.html
Now all our beloved Delphi apps should run flawlessly again :-)