Tray Icon - Popup-Menü verschwindet nicht



  • Hallo!

    Wenn ich ein Tray Icon für eine Applikation erstelle, und dann per Rechtsklick ein Popup Menü anzeigen, dann aber irgendwo anders auf dem Bildschirm hinklicke verschwindet das Popup-Menü nicht, sondern setzt sich hinter die Taskbar und bleibt sichtbar.

    Weiß jemand woran das liegen kann?



  • Problem hat sich erledigt:

    Codeproject schrieb:

    Many people have had troubles using TrackPopupMenu. They have reported that the popup menu will often not disappear once the mouse is clicked outside of the menu, even though they have set the last parameter of TrackPopupMenu() as NULL. This is a Microsoft "feature", and is by design. The mind boggles, doesn't it?

    Anyway - to workaround this "feature", one must set the current window as the foreground window before calling TrackPopupMenu. This then causes a second problem - namely that the next time the menu is displayed it displays then immediately disappears. To fix this problem, you must make the currernt application active after the menu disappears. This can be done by sending a benign message such as WM_NULL to the current window.


Anmelden zum Antworten