Question

I have done flyout window similar to win7 battery meter. It is behaving just like built in one except when it is shown via notify icon who is located on NotifyAreaOverflowWindow aka notify overfow area that window autohides itself after some time while it should hide only when my flyout closes. The only difference that I could spot with spyxx that after some time overflow window simply sends itself an WM_SHOWWINDOW wp:0 lp:0 message.

How can I prevent the overflow window from autohiding while my flyout is active?

screenshot

  • Image 1: Test flyout shown after click on notify icon which is located on overflow area + couple seconds of user inactivity.
  • Image 2: Battery meter flyout shown by clicking on notify icon which is located in overflow area + 2 mins of user inactivity.
Était-ce utile?

La solution

You should call

NotifyWinEvent(EVENT_SYSTEM_MENUPOPUPSTART, Handle, OBJID_CLIENT, 0);

before you show your window and call

NotifyWinEvent(EVENT_SYSTEM_MENUPOPUPEND, Handle, OBJID_CLIENT, 0);

after you hide it.

Autres conseils

Flyouts are no different from any other window.

If I'm understanding your problem, which is that the windows disappear over time, then the solution is quite simple. Do not use whatever NotifyAreaOverflowWindow is. Instead, create your own window, with the appropriate properties (no control box, no max/min buttons, no title text, etc...). Because it's likely out of your control to set the duration of the class/object you're using. It's likely designed for single-notifications, and not something moderately useful ;).

Plus, you'll be able to do fancy things as desired without running into anymore issues.

The following tutorial goes in great lengths on how to position it so perfectly: http://blog.quppa.net/2010/12/09/windows-7-style-notification-area-applications-in-wpf-part-3-taskbar-position/

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top