Setting Application User Model ID of other process
I have a launcher app that starts another app. For the other App to play nicely with Windows 7's taskbars, I have to set the Application User Model ID.
Usually a process has to set this id for itself, by calling SetCurrentPr开发者_如何学编程ocessExplicitAppUserModelID(), but in this specific case I do not have control about the other apps startup code, so I have to set this externally, at best by using some kind of ShellExecute which passes the ID to the app.
Is this possible?
Windows will auto generate a id for the process if it does not call SetCurrentProcessExplicitAppUserModelID, this should be enough for the recent files jumplist section.
If you for whatever reason really want to set a specific id for a 3rd party app, I would try one of these (I have not tried any of these suggestions)
- use SHGetPropertyStoreForWindow on the apps window (I have never tried to set the id like this, but I know you can read the id of another process this way)
- Create a temporary shortcut that launches the app with a specific id
- Inject into the process and call SetCurrentProcessExplicitAppUserModelID
精彩评论