View Issue Details

IDProjectCategoryView StatusLast Update
0033070LazarusCompilerpublic2020-08-02 16:01
Reporterhan Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOSwin10 
Product Version1.8 
Summary0033070: Hints mainmenu submenus are mixed up. Wrong hints are reported
DescriptionHints of mainmenu submenu's are mixed up. Wrong hints are reported. See attached test program. This doesn't happen in the Linux version.

The hints of the mainmenu items work as desired. Only hints of submenu's are affected.
Steps To ReproduceRun attached program and look to the mainmenu hints reported in the statusbar.

See also
https://forum.lazarus.freepascal.org/index.php/topic,39783.0.html
Additional InformationHappens with Lazarus 1.8.0 and 1.6.4.
TagsNo tags attached.
Fixed in Revisionr57147
LazTarget-
Widgetset
Attached Files

Relationships

related to 0033102 resolvedJuha Manninen w32 IDE Crash / range check, when accessing main menu of IDE 

Activities

han

2018-01-24 16:53

reporter  

test program.zip (132,304 bytes)

Serge Anvarov

2018-01-24 20:26

reporter  

menuitem.diff (861 bytes)   
Index: lcl/interfaces/win32/win32callback.inc
===================================================================
--- lcl/interfaces/win32/win32callback.inc	(revision 57143)
+++ lcl/interfaces/win32/win32callback.inc	(working copy)
@@ -438,6 +438,7 @@
 var
   MenuInfo: MENUITEMINFO;
   PopupMenu: TPopupMenu;
+  Menu: HMENU;
 begin
   // first we have to decide if the command is from a popup menu
   // or from the window main menu
@@ -456,7 +457,11 @@
   MenuInfo.cbSize := MMenuItemInfoSize;
   MenuInfo.fMask := MIIM_DATA;
 
-  if GetMenuItemInfo(GetMenu(Window), LOWORD(Integer(WParam)), ByPosition, @MenuInfo) then
+  if ByPosition then
+    Menu := LParam
+  else
+    Menu := GetMenu(Window);
+  if GetMenuItemInfo(Menu, LOWORD(Integer(WParam)), ByPosition, @MenuInfo) then
     Result := TObject(MenuInfo.dwItemData)
   else
     Result := nil;
menuitem.diff (861 bytes)   

Serge Anvarov

2018-01-24 20:26

reporter   ~0106029

Patch added

han

2018-01-24 22:27

reporter   ~0106030

Thanks for the quick response!!

Yes it fixes it partly. The test program is working but at my main application it doesn't work for all popup-menu's. I will try to create a extended test program.

han

2018-01-25 00:13

reporter   ~0106033

I think the problem is fixed.

I have weird problem with my large popup menu but if I copy it to a test application it is gone. Copying back it is also gone in the main application but I have to rebuild the menu actions. Need more time to find outs whats happening in in my application.

han

2018-01-25 11:46

reporter   ~0106040

Last edited: 2018-01-25 11:56

View 2 revisions

It is fixed!

After rebuilding my large popup menu all works fine. Must have been a second problem in my old source code. I did a rigorous check to be sure.

I'm very happy now !!

Juha Manninen

2018-01-25 12:21

developer   ~0106043

Applied, thanks.
Will be merged to fixes_1_8.

han

2020-08-02 16:01

reporter   ~0124502

Closed

Issue History

Date Modified Username Field Change
2018-01-24 16:53 han New Issue
2018-01-24 16:53 han File Added: test program.zip
2018-01-24 20:26 Serge Anvarov File Added: menuitem.diff
2018-01-24 20:26 Serge Anvarov Note Added: 0106029
2018-01-24 22:27 han Note Added: 0106030
2018-01-25 00:13 han Note Added: 0106033
2018-01-25 11:46 han Note Added: 0106040
2018-01-25 11:56 han Note Edited: 0106040 View Revisions
2018-01-25 12:16 Juha Manninen Assigned To => Juha Manninen
2018-01-25 12:16 Juha Manninen Status new => assigned
2018-01-25 12:21 Juha Manninen Fixed in Revision => r57147
2018-01-25 12:21 Juha Manninen LazTarget => -
2018-01-25 12:21 Juha Manninen Note Added: 0106043
2018-01-25 12:21 Juha Manninen Status assigned => resolved
2018-01-25 12:21 Juha Manninen Resolution open => fixed
2018-01-30 21:50 Martin Friebe Relationship added related to 0033102
2020-08-02 16:01 han Status resolved => closed
2020-08-02 16:01 han Note Added: 0124502