Added support for wxEXEC_MAKE_GROUP_LEADER to wxExecute().

Map it to the native CREATE_NEW_PROCESS_GROUP flag as it's broadly similar to
Unix semantics.

Closes #13676.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70051 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-12-19 12:54:48 +00:00
parent 1c959a62ce
commit ee4d438064
4 changed files with 19 additions and 2 deletions

View File

@@ -454,6 +454,10 @@ All (GUI):
- Added wxDataViewItemAttr::SetBackgroundColour() and implemented it in generic
wxDataViewCtrl (Andrew Xu).
MSW:
- Added support for wxEXEC_MAKE_GROUP_LEADER to wxExecute (tteras).
2.9.3: (released 2011-12-14)
------

View File

@@ -342,6 +342,9 @@ enum
// under Unix, if the process is the group leader then passing wxKILL_CHILDREN to wxKill
// kills all children as well as pid
// under Windows (NT family only), sets the CREATE_NEW_PROCESS_GROUP flag,
// which allows to target Ctrl-Break signal to the spawned process.
// applies to console processes only.
wxEXEC_MAKE_GROUP_LEADER = 4,
// by default synchronous execution disables all program windows to avoid

View File

@@ -849,7 +849,12 @@ enum
Under Unix, if the process is the group leader then passing
wxKILL_CHILDREN to wxKill() kills all children as well as pid.
This flag is currently ignored under MSW.
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,
@@ -935,7 +940,8 @@ enum
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

View File

@@ -794,6 +794,10 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler,
DWORD dwFlags = CREATE_SUSPENDED;
#ifndef __WXWINCE__
if ( (flags & wxEXEC_MAKE_GROUP_LEADER) &&
(wxGetOsVersion() == wxOS_WINDOWS_NT) )
dwFlags |= CREATE_NEW_PROCESS_GROUP;
dwFlags |= CREATE_DEFAULT_ERROR_MODE ;
#else
// we are assuming commands without spaces for now