X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32592631588b2f32d7cb336a05b50c74eafd8098..90186e524e347a3a779c928a44fb7d744b3efcf7:/src/msw/utilsexc.cpp?ds=sidebyside diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index ac3c249d08..e74411c229 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". @@ -24,25 +24,27 @@ #include "wx/setup.h" #include "wx/utils.h" #include "wx/app.h" +#include "wx/intl.h" #endif +#include "wx/log.h" #include "wx/msw/private.h" #include #include -#ifndef __GNUWIN32__ +#if !defined(__GNUWIN32__) && !defined(__SALFORDC__) #include +#ifndef __MWERKS__ #include #endif +#endif #ifdef __GNUWIN32__ +#ifndef __TWIN32__ #include #include -#ifndef __MINGW32__ -#include #endif - #endif #ifdef __WIN32__ @@ -72,6 +74,8 @@ struct wxExecuteData { char state; }; + +#ifdef __WIN32__ static DWORD wxExecuteThread(wxExecuteData *data) { WaitForSingleObject(data->process, INFINITE); @@ -81,6 +85,8 @@ static DWORD wxExecuteThread(wxExecuteData *data) return 0; } +#endif + LRESULT APIENTRY _EXPORT wxExecuteWindowCbk(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) @@ -107,7 +113,7 @@ long wxExecute(const wxString& command, bool sync, wxProcess *handler) if (command == "") return 0; -#ifdef __WIN32__ +#if defined(__WIN32__) && !defined(__TWIN32__) char * cl; char * argp; int clen; @@ -130,10 +136,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), @@ -142,6 +146,8 @@ p,i if (((long)result) <= 32) { free(cl); + + wxLogSysError(_("Can't execute command '%s'"), command.c_str()); return 0; } @@ -198,3 +204,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); +}