Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I associate my application with a pinned program on the Windows 7 taskbar?

We have an application, let's call it MyApp. On installation, we create a desktop icon for MyApp, which basically calls MyLauncher.exe /launch MyApp.exe. MyLauncher does some useful stuff (check for updates, etc.), and then starts MyApp.

MyApp on the Desktop

A user with Windows 7 might want to pin it to the task bar (i.e., right mouse button on the desktop icon, "Pin to Taskbar"):

MyApp on the Taskbar

However, since the shortcut points to MyLauncher, the following happens when the user starts the application (either with the desktop icon or the taskbar icon): MyLauncher does its stuff, and, afterwards, it starts MyApp. On the taskbar, the result is as follows:

MyApp twice on the Taskbar

I understand why this happens. Since MyLauncher starts MyApp, the Windows 7 taskbar sees them as two different applications.

Obviously, my question is: As the developer of MyLauncher and MyApp, can I do something about this? I'd like the Windows 7 taskbar to "associate" all instances of MyApp.exe with the shortcut starting MyLauncher.exe /lauch MyApp.exe.

like image 611
Heinzi Avatar asked Mar 15 '12 16:03

Heinzi


1 Answers

Try playing around with the "App Ids" See here for more info: http://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx

"Application User Model IDs (AppUserModelIDs) are used extensively by the taskbar in Windows 7 and later systems to associate processes, files, and windows with a particular application. In some cases, it is sufficient to rely on the internal AppUserModelID assigned to a process by the system. However, an application that owns multiple processes or an application that is running in a host process might need to explicitly identify itself so that it can group its otherwise disparate windows under a single taskbar button and control the contents of that application's Jump List."

like image 79
Mark Sowul Avatar answered Oct 04 '22 15:10

Mark Sowul