tags:

views:

462

answers:

3

Under Windows 7, IE 8 shows every open tab as a taskbar thumbnail. How can I achieve this in my own app?

MSN Messenger exhibits the same behavior.

A: 

The following article should help. There are several new taskbar features in Windows 7, all of them are discussed at the link below.

http://msdn.microsoft.com/en-us/magazine/dd942846.aspx

Note that the Aero Peek feature has nothing to do with task bar buttons, it just lets you make all windows fully transparent to preview your desktop and gadgets. What you were actually looking for is "Windows 7 Grouped Taskbar Thumbnails", in case you need to do additional searches.

jrista
+3  A: 

I believe that this is done with the Windows API Code Pack: http://code.msdn.microsoft.com/WindowsAPICodePack

And here's a blog post explaining how "custom window previews can be used to expose a list of child windows (browser tabs) as thumbnail- and peek-enabled windows in the taskbar." Sounds like what you need: http://blogs.microsoft.co.il/blogs/sasha/archive/2009/02/12/windows-7-taskbar-apis.aspx

Mike Hall
+1  A: 

This is the best reference I've got. Note that I'm assuming native code here, a .NET equivalent could be p/invoke'd up in a fairly straight forward manner.

It boils down to the following:

  • For each tab, create a proxy window
    • For these windows call DwmSetWindowAttribute to set DWMWA_FORCE_ICONIC_REPRESENTATION & DWMWA_HAS_ICONIC_THUMBNAIL
  • Whenever these proxy windows receives a WM_DWMSENDICONICLIVEPREVIEWBITMAP message, render the corresponding thumbnail into the proxy window
    • Whenever a proxy window receives a WM_ACTIVATE, switch to the correct tab
    • You also need to handle WM_SYSCOMMAND
  • Grab your ITaskbarList4
    • Use it to register each of your proxy windows as a tab
    • Manage tab order and what not via the ITaskbarList4 interface (this includes activating tabs)

It seems like there should be a better way to do this, but its all I'm aware of at the moment.

Kevin Montrose