[Scummvm-git-logs] scummvm master -> 39f63f1236e57733189f90ca90fda9aa1e2993f8

bluegr bluegr at gmail.com
Tue Jun 25 06:54:35 CEST 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
39f63f1236 WIN32: Make use of the window handle when calling ShellExecute.


Commit: 39f63f1236e57733189f90ca90fda9aa1e2993f8
    https://github.com/scummvm/scummvm/commit/39f63f1236e57733189f90ca90fda9aa1e2993f8
Author: Henrik "Henke37" Andersson (henke at henke37.cjb.net)
Date: 2019-06-25T07:54:31+03:00

Commit Message:
WIN32: Make use of the window handle when calling ShellExecute.

Changed paths:
    backends/platform/sdl/win32/win32.cpp
    backends/platform/sdl/win32/win32.h


diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index ef101d3..a116e71 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -136,7 +136,7 @@ bool OSystem_Win32::displayLogFile() {
 
 	// Try opening the log file with the default text editor
 	// log files should be registered as "txtfile" by default and thus open in the default text editor
-	HINSTANCE shellExec = ShellExecute(NULL, NULL, _logFilePath.c_str(), NULL, NULL, SW_SHOWNORMAL);
+	HINSTANCE shellExec = ShellExecute(getHwnd(), NULL, _logFilePath.c_str(), NULL, NULL, SW_SHOWNORMAL);
 	if ((intptr_t)shellExec > 32)
 		return true;
 
@@ -169,7 +169,7 @@ bool OSystem_Win32::displayLogFile() {
 }
 
 bool OSystem_Win32::openUrl(const Common::String &url) {
-	HINSTANCE result = ShellExecute(NULL, NULL, /*(wchar_t*)nativeFilePath.utf16()*/url.c_str(), NULL, NULL, SW_SHOWNORMAL);
+	HINSTANCE result = ShellExecute(getHwnd(), NULL, /*(wchar_t*)nativeFilePath.utf16()*/url.c_str(), NULL, NULL, SW_SHOWNORMAL);
 	// ShellExecute returns a value greater than 32 if successful
 	if ((intptr_t)result <= 32) {
 		warning("ShellExecute failed: error = %p", (void*)result);
diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h
index bee160f..9919495 100644
--- a/backends/platform/sdl/win32/win32.h
+++ b/backends/platform/sdl/win32/win32.h
@@ -24,6 +24,7 @@
 #define PLATFORM_SDL_WIN32_H
 
 #include "backends/platform/sdl/sdl.h"
+#include "backends/platform/sdl/win32/win32-window.h"
 
 class OSystem_Win32 : public OSystem_SDL {
 public:
@@ -61,6 +62,8 @@ protected:
 	// Override createAudioCDManager() to get our Mac-specific
 	// version.
 	virtual AudioCDManager *createAudioCDManager();
+	
+	HWND getHwnd() { return ((SdlWindow_Win32*)_window)->getHwnd(); }
 };
 
 #endif





More information about the Scummvm-git-logs mailing list