Fix fdo#35785: recent documents feature of the Windows 7 Start menu broken
Change-Id: I61cffeaf661db7e7b8f642bbbd9457203f75cb9a Reviewed-on: https://gerrit.libreoffice.org/3623 Reviewed-by: Tor Lillqvist <tml@iki.fi> Tested-by: Tor Lillqvist <tml@iki.fi>
This commit is contained in:
committed by
Tor Lillqvist
parent
182f77a46d
commit
64dafbe584
@@ -34,8 +34,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
#define PACKVERSION(major,minor) MAKELONG(minor,major)
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
extern "C" int APIENTRY WinMain( HINSTANCE, HINSTANCE, LPSTR, int )
|
extern "C" int APIENTRY WinMain( HINSTANCE, HINSTANCE, LPSTR, int )
|
||||||
@@ -43,41 +41,6 @@ extern "C" int APIENTRY WinMain( HINSTANCE, HINSTANCE, LPSTR, int )
|
|||||||
extern "C" int APIENTRY _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int )
|
extern "C" int APIENTRY _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int )
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
// 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);
|
|
||||||
|
|
||||||
// Retrieve startup info
|
// Retrieve startup info
|
||||||
|
|
||||||
STARTUPINFO aStartupInfo;
|
STARTUPINFO aStartupInfo;
|
||||||
|
@@ -43,6 +43,5 @@
|
|||||||
#define OFFICE_IMAGE_NAME _T("soffice")
|
#define OFFICE_IMAGE_NAME _T("soffice")
|
||||||
|
|
||||||
extern _TCHAR APPLICATION_SWITCH[];
|
extern _TCHAR APPLICATION_SWITCH[];
|
||||||
extern LPCWSTR APPUSERMODELID;
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -21,6 +21,4 @@
|
|||||||
|
|
||||||
_TCHAR APPLICATION_SWITCH[] = _T( "--base" );
|
_TCHAR APPLICATION_SWITCH[] = _T( "--base" );
|
||||||
|
|
||||||
LPCWSTR APPUSERMODELID = L"TheDocumentFoundation.LibreOffice.Base";
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -21,6 +21,4 @@
|
|||||||
|
|
||||||
_TCHAR APPLICATION_SWITCH[] = _T( "--calc" );
|
_TCHAR APPLICATION_SWITCH[] = _T( "--calc" );
|
||||||
|
|
||||||
LPCWSTR APPUSERMODELID = L"TheDocumentFoundation.LibreOffice.Calc";
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -21,6 +21,4 @@
|
|||||||
|
|
||||||
_TCHAR APPLICATION_SWITCH[] = _T( "--draw" );
|
_TCHAR APPLICATION_SWITCH[] = _T( "--draw" );
|
||||||
|
|
||||||
LPCWSTR APPUSERMODELID = L"TheDocumentFoundation.LibreOffice.Draw";
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -21,6 +21,4 @@
|
|||||||
|
|
||||||
_TCHAR APPLICATION_SWITCH[] = _T( "--impress" );
|
_TCHAR APPLICATION_SWITCH[] = _T( "--impress" );
|
||||||
|
|
||||||
LPCWSTR APPUSERMODELID = L"TheDocumentFoundation.LibreOffice.Impress";
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -21,6 +21,4 @@
|
|||||||
|
|
||||||
_TCHAR APPLICATION_SWITCH[] = _T( "--math" );
|
_TCHAR APPLICATION_SWITCH[] = _T( "--math" );
|
||||||
|
|
||||||
LPCWSTR APPUSERMODELID = L"TheDocumentFoundation.LibreOffice.Math";
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -21,6 +21,4 @@
|
|||||||
|
|
||||||
_TCHAR APPLICATION_SWITCH[] = _T( "--web" );
|
_TCHAR APPLICATION_SWITCH[] = _T( "--web" );
|
||||||
|
|
||||||
LPCWSTR APPUSERMODELID = L"TheDocumentFoundation.LibreOffice.Writer";
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -21,6 +21,4 @@
|
|||||||
|
|
||||||
_TCHAR APPLICATION_SWITCH[] = _T( "--writer" );
|
_TCHAR APPLICATION_SWITCH[] = _T( "--writer" );
|
||||||
|
|
||||||
LPCWSTR APPUSERMODELID = L"TheDocumentFoundation.LibreOffice.Writer";
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
Reference in New Issue
Block a user