Reputation: 1940
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?
Upvotes: 4
Views: 1115
Reputation: 80
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.
Upvotes: 2
Reputation: 3189
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/
Upvotes: 0