]> git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/utilsexc.cpp
avoid system pop-up menu commands being handled by wxApp, bug was shown in printing...
[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 #include "wx/wxprec.h"
13 #ifndef WX_PRECOMP
14 #include "wx/log.h"
15 #include "wx/utils.h"
16 #endif //ndef WX_PRECOMP
17
18 #ifndef __DARWIN__
19
20 #include "wx/mac/private.h"
21 #include "LaunchServices.h"
22
23 long wxExecute(const wxString& command, int flags, wxProcess *WXUNUSED(handler))
24 {
25 wxASSERT_MSG( flags == wxEXEC_ASYNC,
26 wxT("wxExecute: Only wxEXEC_ASYNC is supported") );
27
28 FSRef fsRef ;
29 OSErr err = noErr ;
30 err = wxMacPathToFSRef( command , &fsRef ) ;
31 if ( noErr == err )
32 {
33 err = LSOpenFSRef( &fsRef , NULL ) ;
34 }
35
36 // 0 means execution failed. Returning non-zero is a PID, but not
37 // on Mac where PIDs are 64 bits and won't fit in a long, so we
38 // return a dummy value for now.
39 return ( err == noErr ) ? -1 : 0;
40 }
41
42 #endif //ndef __DARWIN__
43