Delphi “Tray” icon (NotifyIcon) context-menu does not disappear when clicking outside it
I'm trying to show a popup menu when right clicking my Notification Icon, which works fine; But I want the menu to disappear when the user clicks outside of that menu. It's supposedly by design as per KB135788 - PRB: Menus for Notification Icons Do Not Work Correctly ( archive ) . But no decent app I know of behaves like this. I've tried calling SetForegroundWindow using the popup menu's handle to no avail. I'm sure it's possible to work around this, as I've done it years ago but don't remember how. Anyone know how to achieve the expected behaviour? I've found a solution! I was calling