Windows Virtual PC + Seamless Applications + Task Bar = Wrong Icons?

I have been asked a couple of times why the icons in the task bar for seamless applications are all wrong.  If you look at this picture:

seamless2

You will see that while I have three seamless applications running, and they display correctly under task manager, I only have two Windows Virtual PC icons in the task bar – and both of them have the Windows Virtual PC icon instead of the appropriate notepad / live writer / command prompt icons.

To understand what is happening here – you need to know what is going on behind the scenes.  For each virtual machine that is providing seamless applications we have a single copy of vmsal.exe running.  In the above picture I have notepad and command prompt running under a Windows XP virtual machine, and Live Writer running under a Windows 7 virtual machine.  This means that I have two instances of vmsal.exe running.

For each seamless application – we identify the window that we draw in the host, and modify the window name and icon to reflect the application inside the virtual machine.  This is why you see the correct information under task manager.

When the task bar groups windows together, it looks for multiple windows that are managed by the same process, and then uses icon that belongs to the base executable file (rather than the icons that are set on the individual windows).  So as a result the Windows task bar groups separate applications that are being hosted by the same instance of vmsal.exe, and displays the icon that belongs to vmsal.exe.

If you really want to see the right icons, you need to change the process grouping behavior for the task bar.  To do this:

  1. Right click on the task bar and select Properties
  2. Change the Taskbar buttons option to either Combine when taskbar is full or Never combine
  3. Hit OK

When I do this on my system what I get is this:

seamless7

Now I see each seamless application with the right icon and name.

Cheers,
Ben