WinXP: taskbar and Alt-tab icons


#1

DocumentWindow::setIcon will set the title bar icon of a window but it doesn’t seem to change the icons shown on the task bar or when alt-tabbing. Can this be done with juce?

The work I’m doing often involves a handful of top level windows and the WinXP alt-tab box only shows icons, so it’s hard to hit the right one when they all show the icon I put in the exe-file.


#2

Not sure if it can do that - I wrote that code a long time ago, but seem to remember there was some problem with the windowing stuff that got in the way. I’m sure it could be added.


#3

I gave it a try and this trivial solution works for me (XP sp2):

void MyDocumentWindow::setIcon(const Image *imageToUse) { DocumentWindow::setIcon(imageToUse); ComponentPeer *peer = getPeer(); if (peer) peer->setIcon(*imageToUse); }

This gives me consistent icons on Alt-Tab as well as the task bar - provided the window is on the desktop when the icon is set, and stays there.

A more general solution would need to cope with the situation where the peer is created after the icon was set.

Don’t rush for my sake, I’ve got a solution that works for me, but IMO this should be standard behaviour of DocumentWindow::setIcon() - having one icon on the title bar and another on the task bar is a thing to avoid.

I wonder if the problem with the windowing stuff you seem to remember could be related to one of the other platforms; on my XP it just works.


#4

yes, it might have been the mac that didn’t quite fit. Glad that’s working for you anyway.


#5

Hi, I am new in Juce,

I use win7 and VS 2010. I have added icon on the title bar but I could not set icon position. It is located in the center near the title, is there a way to locate it left corner in the title bar?

Thanks.
Regards