summaryrefslogtreecommitdiff
path: root/src/os/windows/win32.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2011-12-11 11:47:08 +0000
committeryexo <yexo@openttd.org>2011-12-11 11:47:08 +0000
commitb4fdba2fb3afcb80e419c048504a118ec8376c09 (patch)
tree036ce622e3bfe2b3176bfe3eecab55f9a943051b /src/os/windows/win32.cpp
parent0143f00d6fbe33f1de293c4149bf8ad05bac4d8a (diff)
downloadopenttd-b4fdba2fb3afcb80e419c048504a118ec8376c09.tar.xz
(svn r23490) -Add [FS#2750]: OpenBrowser function to open a browser on major OSes
Diffstat (limited to 'src/os/windows/win32.cpp')
-rw-r--r--src/os/windows/win32.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp
index 6c7a3ec68..07227222a 100644
--- a/src/os/windows/win32.cpp
+++ b/src/os/windows/win32.cpp
@@ -18,6 +18,7 @@
#include <windows.h>
#include <fcntl.h>
#include <shlobj.h> /* SHGetFolderPath */
+#include <Shellapi.h>
#include "win32.h"
#include "../../core/alloc_func.hpp"
#include "../../openttd.h"
@@ -79,6 +80,11 @@ void ShowOSErrorBox(const char *buf, bool system)
MessageBox(GetActiveWindow(), MB_TO_WIDE(buf), _T("Error!"), MB_ICONSTOP);
}
+void OSOpenBrowser(const char *url)
+{
+ ShellExecute(GetActiveWindow(), _T("open"), MB_TO_WIDE(url), NULL, NULL, SW_SHOWNORMAL);
+}
+
/* Code below for windows version of opendir/readdir/closedir copied and
* modified from Jan Wassenberg's GPL implementation posted over at
* http://www.gamedev.net/community/forums/topic.asp?topic_id=364584&whichpage=1&#2398903 */