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:
		@@ -454,6 +454,10 @@ All (GUI):
 | 
				
			|||||||
- Added wxDataViewItemAttr::SetBackgroundColour() and implemented it in generic
 | 
					- Added wxDataViewItemAttr::SetBackgroundColour() and implemented it in generic
 | 
				
			||||||
  wxDataViewCtrl (Andrew Xu).
 | 
					  wxDataViewCtrl (Andrew Xu).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MSW:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Added support for wxEXEC_MAKE_GROUP_LEADER to wxExecute (tteras).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
2.9.3: (released 2011-12-14)
 | 
					2.9.3: (released 2011-12-14)
 | 
				
			||||||
------
 | 
					------
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -342,6 +342,9 @@ enum
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    // under Unix, if the process is the group leader then passing wxKILL_CHILDREN to wxKill
 | 
					    // under Unix, if the process is the group leader then passing wxKILL_CHILDREN to wxKill
 | 
				
			||||||
    // kills all children as well as pid
 | 
					    // 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,
 | 
					    wxEXEC_MAKE_GROUP_LEADER = 4,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // by default synchronous execution disables all program windows to avoid
 | 
					    // by default synchronous execution disables all program windows to avoid
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -849,7 +849,12 @@ enum
 | 
				
			|||||||
        Under Unix, if the process is the group leader then passing
 | 
					        Under Unix, if the process is the group leader then passing
 | 
				
			||||||
        wxKILL_CHILDREN to wxKill() kills all children as well as pid.
 | 
					        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,
 | 
					    wxEXEC_MAKE_GROUP_LEADER = 4,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -935,7 +940,8 @@ enum
 | 
				
			|||||||
    the new process is a group leader (this will create a new session if
 | 
					    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
 | 
					    needed). Calling wxKill() passing wxKILL_CHILDREN will kill this process as
 | 
				
			||||||
    well as all of its children (except those which have started their own
 | 
					    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
 | 
					    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
 | 
					    place while the child process is running. It should be only used for very
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -794,6 +794,10 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler,
 | 
				
			|||||||
    DWORD dwFlags = CREATE_SUSPENDED;
 | 
					    DWORD dwFlags = CREATE_SUSPENDED;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef __WXWINCE__
 | 
					#ifndef __WXWINCE__
 | 
				
			||||||
 | 
					    if ( (flags & wxEXEC_MAKE_GROUP_LEADER) &&
 | 
				
			||||||
 | 
					            (wxGetOsVersion() == wxOS_WINDOWS_NT) )
 | 
				
			||||||
 | 
					        dwFlags |= CREATE_NEW_PROCESS_GROUP;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    dwFlags |= CREATE_DEFAULT_ERROR_MODE ;
 | 
					    dwFlags |= CREATE_DEFAULT_ERROR_MODE ;
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    // we are assuming commands without spaces for now
 | 
					    // we are assuming commands without spaces for now
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user