For a normal app, such as a.exe, When drag a.exe from explorer to taskbar, a
shortcut to a.exe created.
Double click a.exe in explorer, the taskbar icon shown right( only one icon
shown in task bar).
For a special app, such as b.exe.
I add SetCurrentProcessExplicitAppUserModelID( L"my.test" ); in app's init
function.
When drag b.exe from explorer to taskbar, a shortcut to b.exe created.
Double click b.exe in explorer, the taskbar icon shown wrong( there are two
icon shown in task bar, one is the shortcut, other is the app window).
Could anyone tell me how to fix the issue?
The shortcut needs to have the System.AppUserModel.ID property. That's OK if
the shortcut is created by the software itself (e.g. during installation)
but not so good if it's the user who creates the shortcut.
--
Jim Barry, Microsoft MVP
Well yes, I expect that's because they don't call
SetCurrentProcessExplicitAppUserModelID, so they get the default
system-assigned AppUserModelID.
But I didn't find them.
I don't think it's necessary to have an explicit AppUserModelID in order to
support Jump Lists. You can simply not call SetAppID, right?
pRemovedItems->Release();
}
}
pDestList->Release();
}
return SUCCEEDED(hr);
}
I need call this: pDestList->SetAppID
Does I mis-understand something?
Yes - see the remarks section of the ICustomDestinationList::SetAppID
documentation, where it says:
"Some applications will not declare an explicit AppUserModelID and should
not call this method."
http://msdn.microsoft.com/en-us/library/dd378403(VS.85).aspx
IShellLink *link;
hr = ::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
IID_IShellLink, reinterpret_cast<void**>(&link) );
if (SUCCEEDED(hr))
{
link->SetDescription(L"Calculator");
link->SetPath(L"calc.exe");
pObjColl->AddObject(link);
}
Thanks