3

We have a main application that loads several plugins that have their own individual icons and child windows.

Problem is in Windows 7, the icon in the taskbar is always the icon of the main application, even on the child windows. However, the Alt+Tab menu displays the appropriate icon.

I understand this is due to the pinning feature, and Windows 7 probably uses the icon of the main exe to handle this.

Is there a way we can change the taskbar icon on our child windows? And possibly disabled pinning as well? It would be confusing to be able to pin these child windows, as it wouldn't work properly.

jonathanpeppers
  • 26,115
  • 21
  • 99
  • 182
  • The answer to [this question](http://stackoverflow.com/questions/969033/change-pinned-taskbar-icon-windows-7) may help. – CodeNaked Apr 12 '11 at 13:15
  • It does point me to the Windows 7 API code pack, but I don't know if it will help our situation, as they only mention icon overlays. Sounds like the best we might be able to do is put an icon overlay of the child window's icon, but that may look strange. – jonathanpeppers Apr 12 '11 at 13:54

1 Answers1

2

You can't pin a child window - pinning works at the level of the application. If you pin/unpin a child window, you're (un)pinning the app as a whole. There's no way to disable this behaviour, since it's OS-level functionality that applies to any window in the taskbar (though you could choose not to display those windows in the taskbar).

I'm not sure about the Window icons, but I'd imagine you're right when you say it's just using the application icon.

Dan Puzey
  • 33,626
  • 4
  • 73
  • 96
  • Is there a way to at-least change the icon for the child window? – jonathanpeppers Apr 12 '11 at 13:11
  • Just edited to comment on that - sadly I suspect that as far as the taskbar goes, you're right. – Dan Puzey Apr 12 '11 at 13:12
  • I know you can dynamically change the icon, I've seen it done in Google Chrome: you can pin websites to the start menu. I know these run in their own process, but they are changing the icon from the default Google Chrome icon to use favicon.ico. – jonathanpeppers Apr 12 '11 at 13:14
  • Pinning an icon for a shortcut that's not the applicaton is different. IE9 does the same, and if I launch a pinned IE9 site then all IE9 windows from that process pick up the icon of my pinned site (can't comment on Chrome). I don't think you can have different icons for different windows launched from the same application instance. – Dan Puzey Apr 12 '11 at 13:56
  • Yes, Chrome does the same thing as well. I can pin StackOverflow, for example, but the new taskbar group is a new process, while all the plugins in our application are in the same process. I'll leave this answer up a while, in case, but I'll mark you as the answer if there is no solution. – jonathanpeppers Apr 12 '11 at 16:09