title: "Sticky" MFC popup menu
body: <p>I currently have some toolbar buttons with a small arrow on the side (<code>TBSTYLE_EX_DRAWDDARROWS</code>) that, when clicked, result in a popup context menu being displayed under the button.  This is done by constructing a custom popup menu and calling <code>TrackPopupMenu</code>.</p>
  
  <p>The client now wants to be able to select multiple options from the menu before it closes, so that multiple options can be be modified without the need to re-open the menu and wait for an intermediate redraw between each change.</p>
  
  <p>For example:</p>
  
  <ol>
  <li>User clicks dropdown button</li>
  <li>Dropdown menu appears (modal, waits indefinitely for user action)</li>
  <li>User clicks some item (e.g., toggle a checkmark)</li>
  <li>Timer (e.g., 500ms) starts</li>
  <li>If timer expires, the menu is closed and all selected actions are executed.</li>
  <li>User clicks another item before the timer expires, go back to 4.</li>
  </ol>
  
  <p>The best I can come up with is to redisplay the menu by calling <code>TrackPopupMenu</code> multiple times.  This makes the menu "flicker" when you select an item, and will probably require me to start a thread in order to do the timeouts, which I would rather avoid.</p>