Page 1 of 1
menuitem #WM_MOUSEHOVER #WM_MOUSELEAVE
Posted: Tue Aug 25, 2020 10:55 am
by Rinzwind
Any way to have 'on enter' and 'on leave' events when hovering over a menu item ('blue color') and getting the menuitem ID?
Can't find a way.
Re: menuitem #WM_MOUSEHOVER #WM_MOUSELEAVE
Posted: Tue Aug 25, 2020 1:07 pm
by Rinzwind
something like
Code: Select all
Procedure WindowCallback(id, msg, wp, lp)
Protected r = #PB_ProcessPureBasicEvents
Protected menuID, menuIndex, menuFlags
Select msg
Case #WM_MENUSELECT
menuID = lp
menuIndex = LoWord(wp)
menuFlags = HiWord(wp)
If menuID = MenuID(Menu)
Select menuIndex
Case #MI_Test1
Debug "1"
Case #MI_Test2
Debug "2"
Case #MI_Test3
Debug "3"
EndSelect
EndIf
If menuFlags & #MF_HILITE
Debug "MF_HILITE"
EndIf
If menuFlags & #MF_DISABLED
Debug "MF_DISABLED"
EndIf
If menuFlags & #MF_MOUSESELECT
Debug "MF_MOUSESELECT"
EndIf
Debug "#WM_MENUSELECT " + lp + ";" + menuIndex + "; " + menuFlags
EndSelect
ProcedureReturn r
EndProcedure
works