<div dir="ltr"><br><div class="gmail_extra">On Mon, Apr 29, 2013 at 2:10 PM, Stephan Bergmann <span dir="ltr"><<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>></span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On 04/29/2013 10:31 AM, Jesús Corrius wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
2. Change the thread Application User Model ID when launching a new<br>
component from inside LibO.<br>
</blockquote>
<br></div>
Keeping track of per-thread AppUserModelIDs might be tricky (e.g., for remote UNO access), but documentation like <<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd378459%28v=vs.85%29.aspx" target="_blank">http://msdn.microsoft.com/en-<u></u>us/library/windows/desktop/<u></u>dd378459%28v=vs.85%29.aspx</a>> "Application User Model IDs (AppUserModelIDs)" makes it look like any per-process setting is overridden per-window rather than per-thread anyway?<br>
</blockquote><div><br></div><div style>I found setting the <a href="http://System.AppUserModel.ID">System.AppUserModel.ID</a> property of the application's shortcut file not necessary provided that the file types are correctly mapped in the registry (we already have so) and the launcher sets the AppUserModelID during startup (I removed the code on Friday but it will be back soon). If we set different IDs per launcher (as it is currently in 4.0.x), everything seems to work perfectly fine if you launch the documents by double clicking in the Windows Explorer icon (you have the recent documents without calling SHAddToRecentDocs and you have a "Jump List" menu -- I don't like to call it Jump list in the case because it's just the one provided by Windows, that is we don't really provide one, but i may be a little bit picky here).</div>
<div style><br></div><div style>On the other side, if you then open --double click-- a new document (suppose you open a new spreadsheet and you have a write document already open) the window grouping doesn't work, although the AppUserModelID is set correctly by the launcher. Also the icon on the task bar is not the one of a calc document, but just a plain LibreOffice icon.</div>
<div style><br></div><div style>So during application startup (i.e launcher) we call SetCurrentProcessExplicitAppUserModelID("TheDocumentFoundation.LibreOffice") provided that the Shell32.dll version is equal or higher than 6.1. I guess if we wanted to have "separate applications" we could call SHGetPropertyStoreForWindow for each different app window and set the AppUserModelID, for example, to "TheDocumentFoundation.LibreOffice.Writer". This would make setting a different ID in the launchers unnecessary, although we could need them there to personalize the Jump List menu.</div>
<div style><br></div><div style>Also then we should call SHAddToRecentDocs explicitly. But we could do the trick to not prevent the file dialog to call it, in this way all the documents would be added to the "TheDocumentFoundation.LibreOffice" one and also to the "TheDocumentFoundation.LibreOffice.Writer" one. In this way, the start center, associated only with the main ID could act as a place to store *all* recent documents, while the writer shortcut could only store the list of recent writer documents.</div>
</div><div><br></div>-- <br>Jesús Corrius <<a href="mailto:jesus@softcatala.org" target="_blank">jesus@softcatala.org</a>><br>
</div></div>