Date: | November 10, 2015 / year-entry #235 |
Tags: | other |
Orig Link: | https://blogs.msdn.microsoft.com/oldnewthing/20151110-00/?p=91992 |
Comments: | 8 |
Summary: | Alternate title from a non-programmer point of view: When I copy an executable to another name, sometimes it groups separately, and sometimes it groups with the original. A customer had a product, let's call it Contoso Designer. They decided to try an experimental new version of Contoso Designer. So they cloned the Contoso Designer project,... |
Alternate title from a non-programmer point of view: When I copy an executable to another name, sometimes it groups separately, and sometimes it groups with the original. A customer had a product, let's call it Contoso Designer. They decided to try an experimental new version of Contoso Designer. So they cloned the Contoso Designer project, and then started changing the parts of the program that were related to the experiment. When they did this, they noticed that Contoso Designer Experimental and Contoso Designer both grouped together in the taskbar. This isn't what they wanted, because the original and the experimental versions were not replacements for each other; they are separate programs that merely happen to have started out from the same code base. So they ran another experiment.
They created a scratch project,
put a scratch program in it, compiled it, and ran it.
They then copied the So what was haunted about their project that caused the clone to have a secret psychic connection to the original, and group together with it? And more important, how do they get it to stop? The answer is in the Application User Model ID. As we saw some time ago, the Application User Model ID is how the taskbar identifies applications. If two processes have the same Application User Model ID, then they are treated as the same application, even if the physical executable is different. In other words, the program and its clone were following the instructions in that article and saying, "I want these programs to group together."
Given that nudge, the customer wrote back,
"Thanks.
Updating the call to
I hope they remembered to update their Start menu shortcut, too. |
Comments (8)
Comments are closed. |
One annoying thing about application user model ids is that they are a bit hard to debug. GetCurrentProcessExplicitAppUserModelID only works on explicit ids and only on your own process. GetApplicationUserModelId takes a process handle but does not work on desktop apps for some reason…
What is the .NET equivalent for SetCurrentProcessExplicitAppUserModelID?
Too bad calling SetCurrentProcessExplicitAppUserModelID on Win10 breaks pinning and jumplists…
We have experience something similar before. There was a VB.NET project that we splited and replaced some of the functions to suit some specialized need. And after inital deployment, users reported that both applications won't run together.
We have to change the Assembly GUID in the AssemblyInfo.vb to allow both program run at the same time.
"I hope they remembered to update their Start menu shortcut, too. "
Thats a very big issue under win10 – if you don't set the Application User Model ID in the start menu shortcut (or if there is no shortcut) pinning to taskbar will result in a duplicate taskbar icon. What a s*** – why depending such a functionality on a shortcut to the program?
Jumplist: Huh, I did wonder why a program without a shortcut resulted in a duplicate taskbar icon when I tried to pin it under Windows 10. Thanks for confirming it!
Grouping "related" taskbar items always seemed like a silly thing to do. My various Windows Explorer windows have nothing to do with each other, so I always set my taskbar to "never group". I avoid a whole class of questions this way!
@DWalker: Me too! If I have 3 separable Explorer folder windows (or browser windows, or documents, etc.), I want to see them all in the taskbar so I can very quickly tell what I have open and what their window titles are at a glance. I tend to not have a huge overall number of windows open, so two rows of the taskbar is enough to see all of my windows.