// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+/**
+ Signal constants used by wxProcess.
+*/
+enum wxSignal
+{
+ wxSIGNONE = 0, //!< verify if the process exists under Unix
+ wxSIGHUP,
+ wxSIGINT,
+ wxSIGQUIT,
+ wxSIGILL,
+ wxSIGTRAP,
+ wxSIGABRT,
+ wxSIGEMT,
+ wxSIGFPE,
+ wxSIGKILL, //!< forcefully kill, dangerous!
+ wxSIGBUS,
+ wxSIGSEGV,
+ wxSIGSYS,
+ wxSIGPIPE,
+ wxSIGALRM,
+ wxSIGTERM //!< terminate the process gently
+};
+
+/**
+ Return values for wxProcess::Kill.
+*/
+enum wxKillError
+{
+ wxKILL_OK, //!< no error
+ wxKILL_BAD_SIGNAL, //!< no such signal
+ wxKILL_ACCESS_DENIED, //!< permission denied
+ wxKILL_NO_PROCESS, //!< no such process
+ wxKILL_ERROR //!< another, unspecified error
+};
+
+enum wxKillFlags
+{
+ wxKILL_NOCHILDREN = 0, //!< don't kill children
+ wxKILL_CHILDREN = 1 //!< kill children
+};
+
+enum wxShutdownFlags
+{
+ wxSHUTDOWN_FORCE = 1, //!< can be combined with other flags (MSW-only)
+ wxSHUTDOWN_POWEROFF = 2, //!< power off the computer
+ wxSHUTDOWN_REBOOT = 4, //!< shutdown and reboot
+ wxSHUTDOWN_LOGOFF = 8 //!< close session (currently MSW-only)
+};
+
+
/**
@class wxWindowDisabler
*/
void wxSetDisplayName(const wxString& displayName);
+
+/**
+ flags for wxStripMenuCodes
+*/
+enum
+{
+ // strip '&' characters
+ wxStrip_Mnemonics = 1,
+
+ // strip everything after '\t'
+ wxStrip_Accel = 2,
+
+ // strip everything (this is the default)
+ wxStrip_All = wxStrip_Mnemonics | wxStrip_Accel
+};
+
/**
Strips any menu codes from @a str and returns the result.
wxEnvVariableHashMap env;
};
+/**
+ Bit flags that can be used with wxExecute().
+ */
+enum
+{
+ /**
+ Execute the process asynchronously.
+
+ Notice that, due to its value, this is the default.
+ */
+ wxEXEC_ASYNC = 0,
+
+ /**
+ Execute the process synchronously.
+ */
+ wxEXEC_SYNC = 1,
+
+ /**
+ Always show the child process console under MSW.
+
+ The child console is hidden by default if the child IO is redirected,
+ this flag allows to change this and show it nevertheless.
+
+ This flag is ignored under the other platforms.
+ */
+ wxEXEC_SHOW_CONSOLE = 2,
+
+ /**
+ Make the new process a group leader.
+
+ Under Unix, if the process is the group leader then passing
+ wxKILL_CHILDREN to wxKill() kills all children as well as pid.
+
+ Under MSW, applies only to console applications and is only supported
+ under NT family (i.e. not under Windows 9x). It corresponds to the
+ native @c CREATE_NEW_PROCESS_GROUP and, in particular, ensures that
+ Ctrl-Break signals will be sent to all children of this process as well
+ to the process itself. Support for this flag under MSW was added in
+ version 2.9.4 of wxWidgets.
+ */
+ wxEXEC_MAKE_GROUP_LEADER = 4,
+
+ /**
+ Don't disable the program UI while running the child synchronously.
+
+ By default synchronous execution disables all program windows to avoid
+ that the user interacts with the program while the child process is
+ running, you can use this flag to prevent this from happening.
+
+ This flag can only be used with ::wxEXEC_SYNC.
+ */
+ wxEXEC_NODISABLE = 8,
+
+ /**
+ Don't dispatch events while the child process is executed.
+
+ By default, the event loop is run while waiting for synchronous
+ execution to complete and this flag can be used to simply block the
+ main process until the child process finishes
+
+ This flag can only be used with ::wxEXEC_SYNC.
+ */
+ wxEXEC_NOEVENTS = 16,
+
+ /**
+ Hide child process console under MSW.
+
+ Under MSW, hide the console of the child process if it has one,
+ even if its IO is not redirected.
+
+ This flag is ignored under the other platforms.
+ */
+ wxEXEC_HIDE_CONSOLE = 32,
+
+ /**
+ Convenient synonym for flags given system()-like behaviour.
+ */
+ wxEXEC_BLOCK = wxEXEC_SYNC | wxEXEC_NOEVENTS
+};
/**
Executes another program in Unix or Windows.
wxProcess::OnTerminate() will be called when the process finishes.
Specifying this parameter also allows you to redirect the standard input
and/or output of the process being launched by calling
- wxProcess::Redirect(). If the child process IO is redirected, under Windows
- the process window is not shown by default (this avoids having to flush an
- unnecessary console for the processes which don't create any windows
- anyhow) but a @c wxEXEC_NOHIDE flag can be used to prevent this from
- happening, i.e. with this flag the child process window will be shown
- normally.
+ wxProcess::Redirect().
+
+ Under Windows, when launching a console process its console is shown by
+ default but hidden if its IO is redirected. Both of these default
+ behaviours may be overridden: if ::wxEXEC_HIDE_CONSOLE is specified, the
+ console will never be shown. If ::wxEXEC_SHOW_CONSOLE is used, the console
+ will be shown even if the child process IO is redirected. Neither of these
+ flags affect non-console Windows applications or does anything under the
+ other systems.
Under Unix the flag @c wxEXEC_MAKE_GROUP_LEADER may be used to ensure that
the new process is a group leader (this will create a new session if
needed). Calling wxKill() passing wxKILL_CHILDREN will kill this process as
well as all of its children (except those which have started their own
- session).
+ session). Under MSW, this flag can be used with console processes only and
+ corresponds to the native @c CREATE_NEW_PROCESS_GROUP flag.
The @c wxEXEC_NOEVENTS flag prevents processing of any events from taking
place while the child process is running. It should be only used for very
string, i.e. "emacs file.txt".
@param flags
Must include either wxEXEC_ASYNC or wxEXEC_SYNC and can also include
- wxEXEC_NOHIDE, wxEXEC_MAKE_GROUP_LEADER (in either case) or
- wxEXEC_NODISABLE and wxEXEC_NOEVENTS or wxEXEC_BLOCK, which is equal to
- their combination, in wxEXEC_SYNC case.
+ wxEXEC_SHOW_CONSOLE, wxEXEC_HIDE_CONSOLE, wxEXEC_MAKE_GROUP_LEADER (in
+ either case) or wxEXEC_NODISABLE and wxEXEC_NOEVENTS or wxEXEC_BLOCK,
+ which is equal to their combination, in wxEXEC_SYNC case.
@param callback
An optional pointer to wxProcess.
@param env
additional ones are the command parameters and the array must be
terminated with a @NULL pointer.
@param flags
- Must include either wxEXEC_ASYNC or wxEXEC_SYNC and can also include
- wxEXEC_NOHIDE, wxEXEC_MAKE_GROUP_LEADER (in either case) or
- wxEXEC_NODISABLE and wxEXEC_NOEVENTS or wxEXEC_BLOCK, which is equal to
- their combination, in wxEXEC_SYNC case.
+ Same as for wxExecute(const wxString&,int,wxProcess*) overload.
@param callback
An optional pointer to wxProcess.
@param env
@param output
The string array where the stdout of the executed process is saved.
@param flags
- May include wxEXEC_NOHIDE, wxEXEC_MAKE_GROUP_LEADER (in either case) or
- wxEXEC_NODISABLE and wxEXEC_NOEVENTS or wxEXEC_BLOCK, which is equal to
- their combination. wxEXEC_SYNC is always implicitly added to the flags.
+ Combination of flags to which ::wxEXEC_SYNC is always implicitly added.
@param env
An optional pointer to additional parameters for the child process,
such as its initial working directory and environment variables. This
@param errors
The string array where the stderr of the executed process is saved.
@param flags
- May include wxEXEC_NOHIDE, wxEXEC_MAKE_GROUP_LEADER (in either case) or
- wxEXEC_NODISABLE and wxEXEC_NOEVENTS or wxEXEC_BLOCK, which is equal to
- their combination. wxEXEC_SYNC is always implicitly added to the flags.
+ Combination of flags to which ::wxEXEC_SYNC is always implicitly added.
@param env
An optional pointer to additional parameters for the child process,
such as its initial working directory and environment variables. This