DosSetSession sets or resets one or both of the following parameters related to a child session:
The parameters only affect user selections from the Shell switch list or Shell selections during system hot key processing. They do not affect selections made by the parent session. Thus, when a parent session selects its own session, its own session is brought to the foreground, even if a bond is in effect. When a parent session selects a child session, the child session is brought to the foreground, even if the parent has previously set the child nonselectable.
The above parameters may be set individually. Either can be changed without affecting the current setting of the other.
DosSetSession may only be issued by a parent session for a child session. Neither the parent session itself nor any grandchild, nor any other descendant session beyond a child session, may be the target of this function. DosSetSession may only be issued by the process that originally started the specified session (idSession) through DosStartSession.
DosSetSession may only be used to change the status of child sessions that were originally started by the caller with DosStartSession specifying a value of 1 for Related. That is, DosSetSession may not be used to change the status of sessions started as independent sessions.
A bond established between a parent session and a child session can be broken by reissuing DosSetSession and specifying either:
If a bond is established between session A and its immediate child session B, and if another bond is established between session B and its immediate child session C, then if the operator selects session A, session C is brought to the foreground. However, if session A selects itself, session A is brought to the foreground. If session A selects session B, session C is brought to the foreground. In the latter case, the bond between B and C is honored.
Assume that a bond is established between session A and its immediate child session B, and assume that session B is nonselectable. The operator will not be able to select session B directly. However, if the operator selects session A, session B will be brought to the foreground.
A parent session may be running in either the foreground or the background when DosSetSession is issued.