3

I'm got 2 applications running in Windows 7. The first application is a C++ bootstrapper that launches the second application. I want to change the second application's icon in the Windows taskbar (the bar at the bottom of the screen) programmatically from the first application at runtime.

Is this possible?

Is there a way to create the second process so that it shares a common taskbar icon with the first one?

I'm trying to create a standalone redistributable for ROBLOX games (the second app here is the game player and I'd like to load a game-specific icon, otherwise the user experience will be confusing)

Kara
  • 5,650
  • 15
  • 48
  • 55
John Shedletsky
  • 6,950
  • 10
  • 34
  • 57
  • The concept of giving two programs the same icon to *not* confuse the user is a puzzling one. You can do something in Windows 7, ITaskBar3::SetOverlayIcon(). – Hans Passant Apr 05 '13 at 11:01
  • ITaskbarList3 cannot manipulate another process's taskbar button. Any HWND specified must belong to the calling process that is accessing ITaskBarList3. That is stated as much in the documentation. – Remy Lebeau Apr 05 '13 at 15:36
  • Do you control the code for both of these applications? Can you have the bootstrapper pass a flag to the second application that tells the second application which icon to use? – Adrian McCarthy Apr 05 '13 at 17:04

1 Answers1

1

What you are asking for is generally not possible. Only the process that owns a Taskbar button can manipulate it. A process cannot manipulate another process's Taskbar buttons. Your bootstrapper will likely need to inject code, such as with CreateRemoteThread(), that runs inside of the second process

Remy Lebeau
  • 454,445
  • 28
  • 366
  • 620
  • Ugh that sounds so awful. Thanks for the tip though. – John Shedletsky Apr 10 '13 at 06:53
  • It does not seems to be correct as general rule. it is possible to change process title from another process which will affect process taskbar button too. look http://stackoverflow.com/questions/1016823/c-sharp-how-can-i-rename-a-process-window-that-i-started – AaA Aug 19 '14 at 02:05
  • That changes the title of the window that owns the taskbar button, which *indirectly* changes the text of the taskbar button. But that is all it cando. If you really want to manipulate another process's taskbar button, especially its icon (which this question was asking about), then have a look at [another answer I posted](http://stackoverflow.com/a/24274703/65863) earlier this year, which includes a link to an article on manipulating the Taskbar directly. – Remy Lebeau Aug 19 '14 at 03:26