]> git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/utilsexc.cpp
move offscreen before in order to avoid transitions for mdiparent frame as it suppose...
[wxWidgets.git] / src / mac / carbon / utilsexc.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: utilsexec.cpp
3 // Purpose: Execution-related utilities
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 1998-01-01
7 // RCS-ID: $Id$
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifdef __GNUG__
13 //#pragma implementation
14 #endif
15
16 #include "wx/wxprec.h"
17 #ifndef WX_PRECOMP
18 #include "wx/log.h"
19 #include "wx/utils.h"
20 #endif //ndef WX_PRECOMP
21
22 #ifndef __DARWIN__
23
24 #include "wx/mac/private.h"
25 #include "LaunchServices.h"
26
27 long wxExecute(const wxString& command, int flags, wxProcess *WXUNUSED(handler))
28 {
29 wxASSERT_MSG( flags == wxEXEC_ASYNC,
30 wxT("wxExecute: Only wxEXEC_ASYNC is supported") );
31
32 FSRef fsRef ;
33 OSErr err = noErr ;
34 err = wxMacPathToFSRef( command , &fsRef ) ;
35 if ( noErr == err )
36 {
37 err = LSOpenFSRef( &fsRef , NULL ) ;
38 }
39
40 // 0 means execution failed. Returning non-zero is a PID, but not
41 // on Mac where PIDs are 64 bits and won't fit in a long, so we
42 // return a dummy value for now.
43 return ( err == noErr ) ? -1 : 0;
44 }
45
46 #endif //ndef __DARWIN__
47