TComboBox and TPopupMenu? lazarus / 31-LCL ---------------------------------------------------------------------- Avishai · 2013-12-02 10:21 On MSWindows I just discovered that if I set a PopupMenu for a TComboBox I still get the Default Window PopupMenu instead of the one I assigned.  Is this normal?  I wouldn't think so but... What about on other OS's? ---------------------------------------------------------------------- engkin · 2013-12-03 06:18 I don't think this is the intended behavior. I noticed that right- clicking on the drop-down arrow brings up the popup menu. It seems to work ok with a style that has no edit box like csDropDownList. ---------------------------------------------------------------------- Avishai · 2013-12-03 06:29 Thanks engkin.  The only Delphi I have is Delphi 6, but PopupMenu works normally with ComboBox. ---------------------------------------------------------------------- Avishai · 2013-12-03 11:56 I reported it in BugTracker.  If this behavior is by design, it's poor design. ---------------------------------------------------------------------- engkin · 2013-12-03 18:17 On Windows, the OS sends WM_CONTEXTMENU to the window that should show the pop-up menu. I dug a little bit in the source code and I found that for Windows WidgetSet there is a common WindowProc declared in: $(LazarusDir)\lcl\interfaces\win32\win32int.pp and its code is in win32callback.inc Code: [Select]function WindowProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam; LParam: Windows.LParam): LResult; stdcall; begin ...   if WindowInfo^.isChildEdit then   begin ...     // filter messages we want to pass on to LCL     if (Msg <> WM_KILLFOCUS) and (Msg <> WM_SETFOCUS) ...     ((Msg < WM_MOUSEFIRST) or (Msg > WM_MOUSELAST)) then     begin       Result := CallDefaultWindowProc(Window, Msg, WParam, LParam);       exit;     end ... As you can see, it filters that message. The values for related  messages are: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i      WM_CONTEXTMENU = 123;...     WM_MOUSEFIRST = 512;  A fix would let WM_CONTEXTMENU for a child edit pass to the control: Code: [Select]    // filter messages we want to pass on to LCL     if (Msg <> LM_CONTEXTMENU)       and (Msg <> WM_KILLFOCUS) and (Msg <> WM_SETFOCUS)