I'm developing a custom autocomplete control in pure WinApi, and the problem that I've encountered is that I don't know how to hide the popup window when clicked outside of the control (e.g. emulate the combobox dropdown behavior). How is it usually implemented? Should I use mouse capture? Thanks.
UPD: Tracking keyboard focus doesn't fit the bill since dragging the parent window around should also hide the dropdown.
UPD: Mouse capture doesn't work because it "captures mouse input either when the mouse is over the capturing window, or when the mouse button was pressed while the mouse was over the capturing window and the button is still down".