Popupmenu for menuitem? lazarus / 31-LCL ---------------------------------------------------------------------- SpaceGit · 2025-04-05 13:33 Is it possible to have a popupmenu for a menuitem when it is right- clicked? Preferably crossplatform, but failing that I will settle for windows support Thank you in advance for any and all suggestions ---------------------------------------------------------------------- Remy Lebeau · 2025-04-05 17:04 Quote from: SpaceGit on April 05, 2025, 03:33:24 pmIs it possible to have a popupmenu for a menuitem when it is right-clicked? Preferably crossplatform, but failing that I will settle for windows support It is possible on Windows, yes. Whether or not the LCL natively supports this, I don't know. In Win32 API terms, you need to handle the WM_MENURBUTTONUP message that is sent to the 1st menu's owner window, and then display the 2nd popup menu using TrackPopupMenuEx() with the TPM_RECURSE flag specified. ---------------------------------------------------------------------- jamie · 2025-04-05 23:03 In order to capture that message the form's message handler needs to be hookee. Overriding the wndproc wont cut it because the lcl blocks it I wrote a class that makes it easy to force the form class to pass all desired messages so they can be handled normally.   I posted it here at one time "ezmessages" ---------------------------------------------------------------------- jamie · 2025-04-06 19:29 I attached a project that uses my msghook i wrote with some code examples of device detection, form moving etc ---------------------------------------------------------------------- jamie · 2025-04-06 22:50 I wanted to let you know that I tried the WM_MENURBUTTONUP message, Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Procedure TForm1.WmMenuRButtonUp(var Msg:TMessage);Begin  TrackPopUpMenuEx(PopUp Menu1.Handle,TPM_RECURSE,Mouse.cursorpos.x,mouse.cursorpos.y,Handle,ni l);End;                                                                                           and it does work, just add the message to the msghook and implement the message handler normally. ---------------------------------------------------------------------- SpaceGit · 2025-04-10 15:25 Thank you Jamie And the rest of yous