From 3c086e50d36f4cba566ed366bc546744372aec40 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Tue, 5 Jan 2016 13:47:21 +0100 Subject: winrt: handle PrelaunchActivated property to pass certification Windows 10 requires apps to handle the PrelaunchActivated property. This enables a faster startup by launching an app and immediately suspending it. This happens by the system and at the time the user launches the app no library loading or initialization is required. By default we opt-out of this and return early. The reason is that we cannot know the type of application written in Qt and whether it breaks the guidelines by using prelaunch. For further details check here: https://msdn.microsoft.com/en-us/library/windows/apps/mt593297.aspx Task-number: QTBUG-50292 Change-Id: I4d0b0b95a03f93b99211d042895404a88ea7cb9d Reviewed-by: Oliver Wolff --- src/winmain/qtmain_winrt.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/winmain') diff --git a/src/winmain/qtmain_winrt.cpp b/src/winmain/qtmain_winrt.cpp index 098ae45dc8..9e5f206ea5 100644 --- a/src/winmain/qtmain_winrt.cpp +++ b/src/winmain/qtmain_winrt.cpp @@ -198,6 +198,15 @@ private: HRESULT __stdcall OnLaunched(ILaunchActivatedEventArgs *launchArgs) Q_DECL_OVERRIDE { #if _MSC_VER >= 1900 + ComPtr preArgs; + HRESULT hr = launchArgs->QueryInterface(preArgs.GetAddressOf()); + if (SUCCEEDED(hr)) { + boolean prelaunched; + preArgs->get_PrelaunchActivated(&prelaunched); + if (prelaunched) + return S_OK; + } + commandLine = QString::fromWCharArray(GetCommandLine()).toUtf8(); #endif HString launchCommandLine; -- cgit v1.2.3