Improved Launcher::openFile() method for Windows using ShellExecute() instead of system().

This commit is contained in:
David Capello 2010-07-06 23:29:40 -03:00
parent e97aa018a3
commit ff705fce46
2 changed files with 12 additions and 1 deletions

View File

@ -20,6 +20,10 @@
#include "launcher.h"
#if defined ALLEGRO_WINDOWS
#include <windows.h>
#endif
void Launcher::openUrl(const std::string& url)
{
openFile(url);
@ -29,7 +33,7 @@ void Launcher::openFile(const std::string& file)
{
#if defined ALLEGRO_WINDOWS
system(("start " + file).c_str());
ShellExecute(NULL, "open", file.c_str(), NULL, NULL, SW_SHOWNORMAL);
#elif defined ALLEGRO_MACOSX

View File

@ -33,6 +33,10 @@
#include <vector>
#include <cassert>
#ifdef VACA_ON_WINDOWS
#include <windows.h>
#endif
using namespace Vaca;
Application* Application::m_instance = NULL;
@ -40,6 +44,9 @@ std::vector<String> Application::m_args;
Application::Application()
{
#ifdef VACA_ON_WINDOWS
CoInitialize(NULL);
#endif
}
Application::~Application()