From b07a06745eb79057ccc08bc908b2df866bc38ac0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 3 Jan 2017 09:40:40 +0100 Subject: Windows QPA/Services: Do not invoke MailToProtocolHandler of url.dll As of Windows 10, MailToProtocolHandler is set as handler for mailto URLs if there is no mail client installed. As it silently fails or brings up a broken dialog after a long time, exclude it and fall back to ShellExecute() which brings up the URL assocation dialog. Task-number: QTBUG-57816 Change-Id: Ia8c09676bc44848e0549c06c3a82c9b5cce79279 Reviewed-by: Jesus Fernandez Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowsservices.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/windows/qwindowsservices.cpp') diff --git a/src/plugins/platforms/windows/qwindowsservices.cpp b/src/plugins/platforms/windows/qwindowsservices.cpp index 7f9c9bd205..48332b35f8 100644 --- a/src/plugins/platforms/windows/qwindowsservices.cpp +++ b/src/plugins/platforms/windows/qwindowsservices.cpp @@ -98,7 +98,11 @@ static inline QString mailCommand() RegQueryValueEx(handle, L"", 0, 0, reinterpret_cast(command), &bufferSize); RegCloseKey(handle); } - if (!command[0]) + // QTBUG-57816: As of Windows 10, if there is no mail client installed, an entry like + // "rundll32.exe .. url.dll,MailToProtocolHandler %l" is returned. Launching it + // silently fails or brings up a broken dialog after a long time, so exclude it and + // fall back to ShellExecute() which brings up the URL assocation dialog. + if (!command[0] || wcsstr(command, L",MailToProtocolHandler") != nullptr) return QString(); wchar_t expandedCommand[MAX_PATH] = {0}; return ExpandEnvironmentStrings(command, expandedCommand, MAX_PATH) ? -- cgit v1.2.3