title: How to know if a TToolButton's MenuItem is dropped down?
body: <p>In the context of an owner-draw toolbar used to host menu entries (TToolButtons with their MenuItem and Grouped properties set), I want to know if the corresponding menuitem is dropped. The problem is that the State property in the OnAdvancedCustomDrawButton doesn't reflect that information.</p>
  
  <p>When the toolbutton is clicked, its Down property is true, but in the particular case above (MenuItem set and Grouped=True), just after the menu is dropped, another OnAdvancedCustomDrawButton is fired but this time with Down set to false.</p>
  
  <p>This means that I end up drawing the button with a NOT down state.</p>
  
  <p>Looking at the source of the VCL, it seems the information about which toolbutton is dropped is stored in the TToolBar's FMenuButton <em>private</em> field, and Windows is notified of the hot state by a Perform(TB_SETHOTITEM), however neither of these provide read-access...</p>
  
  <p>Also the VCL performs the dropdown via a private FTempMenu, whose handle is thus not accessible.</p>
  
  <p><strong>PS:</strong> FWIW if using the hacky solution, the only private field usable seems to be FButtonMenu which will have to be compared against your Button.MenuItem in the CustomDraw, the others private fiels are either not set early enough (like FMenuButton) or are private variables (like MenuButtonIndex) with a variable location. Still not too satisfying though.</p>