Link to home
Start Free TrialLog in
Avatar of r2far
r2far

asked on

Window Z-Order and Taskbar

Quick question here.

Have a pop-up window that I have animate into the screen.  I wish to set the Z-Order of this window to be just below the task bar.  As in, it will be above all other windows except the taskbar.  This is to simulate the window popping up from below the tasbar instead of the edge of the screen.

The problem with SetWindowPos is that is 'inserts after' so even IF i knew how to get the task bar window pointer, it would still place my window above the taskbar.

Another issue that might arise is that when a fullscreen app or game is running, I do not want my window trying to force itself to draw above the fullscreen app.  Thus producing a flicker in the fullscreen app and possibly introduce a fight for user input control.
Avatar of mahesh1402
mahesh1402
Flag of India image

If you want to create a window that is drawn in front of the taskbar instead of behind it then you may try creating window with WS_EX_TOPMOST extended window style.

MAHESH
Avatar of r2far
r2far

ASKER

Thank you for your response mahesh,

However I wish the window to appear to pop-up from BEHIND the window.  At current it already pops up in front of it as I have been using the TOPMOST flag.
Avatar of r2far

ASKER

CORRECTION:  I wish the window to appear to pop-up from BEHIND the >>TASKBAR<<
>>CORRECTION:  I wish the window to appear to pop-up from BEHIND the >>TASKBAR<<

Just be clear : You want window to appear behind taskbar or front of taskbar ? As its now behind taskbar and if you want it in front of taskbar that is TOP to taskbar just make it WS_EX_TOPMOST extended window style.

MAHESH
Avatar of r2far

ASKER

As stated in my original question.  I want it above all other windows, except the taskbar.  I do not want the window animating onto the screen in a manner that covers up the clock and system tray icons.
ASKER CERTIFIED SOLUTION
Avatar of mahesh1402
mahesh1402
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of r2far

ASKER

Thank You,

But perhaps i should explain my intent.  The window 'animates' from off-screen onto the screen.  It is designed to relay information from a running service.  The window will not be movable, it will just animate onto the screen at the same corner as the tasbar clock, then animate out after either a time elapse or user input (this is working).  It is just a matter of estetics to have it not cover up the clock and system tray icons as it does this animation.  Its final position is just above the taskbar, its only during the animation that it covers the taskbar.  Animating from 'under' the tasbar is also requested behavior as another element of the program is a system tray icon that changes when the service sends communications to this application.

If i use the 'wndTop' flag, my window will get pushed behind the other windows when it loses focus.  I still want the window to appear above the other, non-taskbar, windows even after losing focus.  I 'have' been using SetWindowPos with the 'wndTopMost' flag which produce the desired effect EXCEPT it also covers the taskbar.

But the concept you mentioned, about snapping the window to the taskbar, might be useful in the future *wink
Avatar of r2far

ASKER

Well I have determined a solution on my own.

It involves both, moving the window with SetWindowPos(), as well as modifying the the windows region to 'squish' against the taskbar.  The results being that the region prohibits the window drawing anything beyond the taskbar edge even though the window itself is moving.  I can tell you it was 'fun' setting up the equations for all this as my code also handles the taskbar being in various positions on the desktop.

I will award points as your answers have some mild relavence.
Hey , I have been trying to the same but for another reason. I am also using setwindowpos() .It successfully show above the all windows since I am using "-1" as topmost parameter in this function. But I want my window to hide behind the taskbar which is not happening and I can't squish my window. I want the part which is overlapping the taskbar should go behind it.
If you found any solution. Please do share.
Thanks You