X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5260b1c582632afeb8f25db7f10697c8d45461b4..9d133d8787de36494207675475eda4ef7a9f11f4:/src/msw/utilsexc.cpp?ds=sidebyside diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index ef2e39750b..4140571003 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -10,7 +10,7 @@ ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ -#pragma implementation "utils.h" +#pragma implementation #endif // For compilers that support precompilation, includes "wx.h". @@ -26,6 +26,7 @@ #include "wx/app.h" #endif +#include "wx/log.h" #include "wx/msw/private.h" #include @@ -33,16 +34,14 @@ #ifndef __GNUWIN32__ #include +#ifndef __MWERKS__ #include #endif +#endif #ifdef __GNUWIN32__ #include #include -#ifndef __MINGW32__ -#include -#endif - #endif #ifdef __WIN32__ @@ -63,10 +62,6 @@ #endif #include -IMPLEMENT_DYNAMIC_CLASS(wxProcessEvent, wxEvent) -IMPLEMENT_DYNAMIC_CLASS(wxProcess, wxEvtHandler) - - #define wxEXECUTE_WIN_MESSAGE 10000 struct wxExecuteData { @@ -138,10 +133,8 @@ long wxExecute(const wxString& command, bool sync, wxProcess *handler) *argp++ = '\0'; #ifdef __GNUWIN32__ - result = ShellExecute((HWND) (wxTheApp->GetTopWindow() ? (HWND) wxTheApp->GetT -opWindow()->GetHWND() : NULL), - (const wchar_t) "open", (const wchar_t) cl, (const wchar_t) arg -p,i + result = ShellExecute((HWND) (wxTheApp->GetTopWindow() ? (HWND) wxTheApp->GetTopWindow()->GetHWND() : NULL), + (const wchar_t) "open", (const wchar_t) cl, (const wchar_t) argp, (const wchar_t) NULL, SW_SHOWNORMAL); #else result = ShellExecute( (HWND) (wxTheApp->GetTopWindow() ? wxTheApp->GetTopWindow()->GetHWND() : NULL), @@ -150,6 +143,8 @@ p,i if (((long)result) <= 32) { free(cl); + + wxLogSysError(_("Can't execute command '%s'"), command.c_str()); return 0; } @@ -206,3 +201,16 @@ p,i return(instanceID); #endif } + +long wxExecute(char **argv, bool sync, wxProcess *handler) +{ + wxString command = ""; + + while (*argv != NULL) { + command += *argv; + command += ' '; + argv++; + } + command.RemoveLast(); + return wxExecute(command, sync, handler); +}