]> git.saurik.com Git - wxWidgets.git/blame - src/mac/carbon/utilsexc.cpp
Enable UpdateUI events in wxTaskBarIcon.
[wxWidgets.git] / src / mac / carbon / utilsexc.cpp
CommitLineData
e9576ca5
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: utilsexec.cpp
3// Purpose: Execution-related utilities
a31a5f85 4// Author: Stefan Csomor
5d553c56 5// Modified by:
a31a5f85 6// Created: 1998-01-01
e9576ca5 7// RCS-ID: $Id$
a31a5f85 8// Copyright: (c) Stefan Csomor
65571936 9// Licence: wxWindows licence
e9576ca5
SC
10/////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
90771fe5 13//#pragma implementation
e9576ca5
SC
14#endif
15
5d553c56
DE
16#include "wx/wxprec.h"
17#ifndef WX_PRECOMP
18 #include "wx/log.h"
19 #include "wx/utils.h"
20#endif //ndef WX_PRECOMP
e9576ca5 21
f5c6eb5c 22#ifndef __DARWIN__
e9576ca5 23
fadb227e 24#include "wx/mac/private.h"
a2b77260 25#include "LaunchServices.h"
fadb227e
DS
26
27long wxExecute(const wxString& command, int flags, wxProcess *WXUNUSED(handler))
e9576ca5 28{
fadb227e
DS
29 wxASSERT_MSG( flags == wxEXEC_ASYNC,
30 wxT("wxExecute: Only wxEXEC_ASYNC is supported") );
31
a2b77260
SC
32 FSRef fsRef ;
33 OSErr err = noErr ;
34 err = wxMacPathToFSRef( command , &fsRef ) ;
35 if ( noErr == err )
36 {
37 err = LSOpenFSRef( &fsRef , NULL ) ;
38 }
fadb227e
DS
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.
a2b77260 43 return ( err == noErr ) ? -1 : 0;
e9576ca5 44}
fadb227e 45
5d553c56 46#endif //ndef __DARWIN__
5fde6fcc 47