From 1f2a50bcd354e3aae80ce4f99e50f618a7b83e3c Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Fri, 9 Sep 2016 23:51:40 +0100 Subject: CLOUD: Move openUrl to OSystem --- backends/platform/sdl/win32/win32.cpp | 12 +++++++++++- backends/platform/sdl/win32/win32.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'backends/platform/sdl/win32') diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index fcc0849624..99c71a49e0 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -94,7 +94,7 @@ void OSystem_Win32::initBackend() { bool OSystem_Win32::hasFeature(Feature f) { - if (f == kFeatureDisplayLogFile) + if (f == kFeatureDisplayLogFile || f == kFeatureOpenUrl) return true; return OSystem_SDL::hasFeature(f); @@ -135,6 +135,16 @@ bool OSystem_Win32::displayLogFile() { return false; } +bool OSystem_Win32::openUrl(const Common::String &url) { + const uint64 result = (uint64)ShellExecute(0, 0, /*(wchar_t*)nativeFilePath.utf16()*/url.c_str(), 0, 0, SW_SHOWNORMAL); + // ShellExecute returns a value greater than 32 if successful + if (result <= 32) { + warning("ShellExecute failed: error = %u", result); + return false; + } + return true; +} + Common::String OSystem_Win32::getDefaultConfigFileName() { char configFile[MAXPATHLEN]; diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h index ca0843e834..636ebae88f 100644 --- a/backends/platform/sdl/win32/win32.h +++ b/backends/platform/sdl/win32/win32.h @@ -36,6 +36,8 @@ public: virtual bool displayLogFile(); + virtual bool openUrl(const Common::String &url); + protected: /** * The path of the currently open log file, if any. -- cgit v1.2.3