The Delphi Bug List

Entry No.
592
VCL - Standard - StdCtrls - TPopupMenu
Popup menu ceases to function when MenuAnimation is used
1.02 2.01 3.0 3.01 3.02 4.0 4.01 4.02 4.03 5.0 5.01 6.0 6.01 6.02 Kylix 1.0
N/AN/AN/AN/AN/AN/AN/AN/AN/AExistsFixedExistsExistsExistsN/A
Description
Reported by Jordan Russell; checked by Reinier Sterkenburg, Odd Dahm Selen
Create a popup menu on a form, add some items to it, and assign the popup menu to the form's PopupMenu property. On Windows NT 4.0 (probably 95 also), run the program, and observe that popup menu is displayed correctly when you right-click the form. Now go back to the popup menu and change the MenuAnimation property (anything other than [] will do). Run the program again, and observe that nothing happens when you right-click the form.

This happens because the TrackPopupMenu call which is supposed to display the popup menu is failing with error code 1004 -- "Invalid flags". Why? Because it includes the flags for animation even if the user isn't running Windows 98 or 2000 (the only OSes which currently recognize those flags). This behavior contradicts the documentation on MenuAnimation which says:
"Note: MenuAnimation only has an effect when running on Windows 98, NT 5.0, or later."

It certainly does have an effect on prior Windows versions -- the effect being the menus entirely cease to function.

Yes, this bug was fixed in Delphi 5.01, but was reintroduced in Delphi 6.

Latest update of this entry: 2002-03-13

Post a comment on this bug


Index page
Delphi Bug List home page
The Delphi Bug Lists are presently maintained by Jordan Russell, who has taken over this task from Reinier Sterkenburg since August 2000.
All feedback is appreciated. See also the feedback section of the Delphi Bug List home page.