Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/3639
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/39/3639/1
fdo#35785: don't rely on the old apps fallback mechanism to fix this bug
Change-Id: Id0967358956868538f7563c51f7ed5e106771302
---
M desktop/win32/source/applauncher/launcher.cxx
1 file changed, 39 insertions(+), 1 deletion(-)
diff --git a/desktop/win32/source/applauncher/launcher.cxx
b/desktop/win32/source/applauncher/launcher.cxx
index 0edcdbf..c6a40d3 100644
--- a/desktop/win32/source/applauncher/launcher.cxx
+++ b/desktop/win32/source/applauncher/launcher.cxx
@@ -34,6 +34,9 @@
#include <stdlib.h>
#include <malloc.h>
+#define PACKVERSION(major,minor) MAKELONG(minor,major)
+#define APPUSERMODELID L"TheDocumentFoundation.LibreOffice"
+
#ifdef __MINGW32__
extern "C" int APIENTRY WinMain( HINSTANCE, HINSTANCE, LPSTR, int )
@@ -41,7 +44,42 @@
extern "C" int APIENTRY _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int )
#endif
{
- // Retrieve startup info
+ // Set an explicit Application User Model ID for the process
+
+ WCHAR szShell32[MAX_PATH];
+ GetSystemDirectoryW(szShell32, MAX_PATH);
+ wcscat(szShell32, L"\\Shell32.dll");
+
+ HINSTANCE hinstDll = LoadLibraryW(szShell32);
+
+ if(hinstDll)
+ {
+ DLLVERSIONINFO dvi;
+ ZeroMemory(&dvi, sizeof(dvi));
+ dvi.cbSize = sizeof(dvi);
+
+ DLLGETVERSIONPROC pDllGetVersion;
+ pDllGetVersion = (DLLGETVERSIONPROC)GetProcAddress(hinstDll, "DllGetVersion");
+ HRESULT hr = (*pDllGetVersion)(&dvi);
+
+ if(SUCCEEDED(hr))
+ {
+ DWORD dwVersion = PACKVERSION(dvi.dwMajorVersion, dvi.dwMinorVersion);
+ if(dwVersion >= PACKVERSION(6,1)) // Shell32 version in Windows 7
+ {
+ typedef HRESULT (WINAPI *SETCURRENTPROCESSEXPLICITAPPUSERMODELID)(PCWSTR);
+ SETCURRENTPROCESSEXPLICITAPPUSERMODELID pSetCurrentProcessExplicitAppUserModelID;
+ pSetCurrentProcessExplicitAppUserModelID =
+ (SETCURRENTPROCESSEXPLICITAPPUSERMODELID)GetProcAddress(hinstDll,
"SetCurrentProcessExplicitAppUserModelID");
+
+ if(pSetCurrentProcessExplicitAppUserModelID)
+ (*pSetCurrentProcessExplicitAppUserModelID) (APPUSERMODELID);
+ }
+ }
+ }
+ FreeLibrary(hinstDll);
+
+ // Retreive startup info
STARTUPINFO aStartupInfo;
--
To view, visit https://gerrit.libreoffice.org/3639
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id0967358956868538f7563c51f7ed5e106771302
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Jesús Corrius <jcorrius@gmail.com>
Context
- [PATCH] fdo#35785: don't rely on the old apps fallback mechanism to ... · via Code Review
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.