Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Window Z-Order and Taskbar

Posted on 2006-04-21
8
Medium Priority
?
831 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:r2far
  • 5
  • 3
8 Comments
 
LVL 22

Expert Comment

by:mahesh1402
ID: 16514263
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
0
 
LVL 4

Author Comment

by:r2far
ID: 16515437
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.
0
 
LVL 4

Author Comment

by:r2far
ID: 16515487
CORRECTION:  I wish the window to appear to pop-up from BEHIND the >>TASKBAR<<
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:mahesh1402
ID: 16517790
>>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
0
 
LVL 4

Author Comment

by:r2far
ID: 16526636
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.
0
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 500 total points
ID: 16531950
>>I want it above all other windows, except the taskbar.

Instead of this you may just Make your window top most  using SetWindowPos(&CWnd::wndTop,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE) and then maintain your bottom position of window such that it will not just cover taskbar. You may do this by trapping WM_MOVE message. Add handler for this OnMove() and in this function you may check position of your window while moving ..if its just about to overlap use MoveWindow() or SetWindowPost() to set it to above taskbar forcefully.

MAHESH
0
 
LVL 4

Author Comment

by:r2far
ID: 16535162
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
0
 
LVL 4

Author Comment

by:r2far
ID: 16563832
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.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses
Course of the Month15 days, 21 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question