OE.Net how to control order of forms on taskbar

Posted by cverbiest on 26-Dec-2016 03:10

Windows shows the forms in the taskbar in the wrong order.

I start our menu screen (1),

from the menu I launch a grid (2), this gets displayed before the menu, I expect it after the menu

from the grid I start a property screen (3). now this gets displayed after the menu

I'd like the order of screens in the taskbar to be 1, 2, 3.

I don't know how to control this

Posted by Mike Fechner on 04-Jan-2017 14:44

I did indeed cover the Microsoft.WindowsAPICodePack.Taskbar.TaskBarManager class in some of my presentations. But as far as I can see that does not have any method which could reorder windows behind a taskbar icon.

All Replies

Posted by Matt Gilarde on 28-Dec-2016 06:38

The taskbar is part of explorer.exe and there's no interface for rearranging the thumbnails. There are third-party tools that make it possible for the user to rearrange them by dragging but I don't know of any that provide a programmatic interface.

I'm assuming that the grid is created after the menu is created. Is that correct? From what I can tell, Windows determines the order of the thumbnails by looking at the z-order of the windows. I wonder if your grid is initially being displayed behind the menu. You may be able to force the thumbnail order you want by setting the grid form's TopMost property to true before displaying the grid. You can set it back to false after the grid is displayed.

Posted by gdb390 on 04-Jan-2017 09:57

Didn"t Mike gave once a session about that ?

Posted by Mike Fechner on 04-Jan-2017 14:44

I did indeed cover the Microsoft.WindowsAPICodePack.Taskbar.TaskBarManager class in some of my presentations. But as far as I can see that does not have any method which could reorder windows behind a taskbar icon.

This thread is closed