A process calls DosSetSession to set the selectability of a child session. When a child session is selectable, the user can select it from the Window List or by using Alt+Esc. When a child session is nonselectable, the user cannot select the session from the Window List or move to it by using the Alt+Esc keys.
In the following code fragment, DosSetSession makes a child session nonselectable:
#define INCL_DOSPROCESS /* Process and thread values */ #define INCL_DOSSESMGR #include <os2.h> ULONG ulSessionID; STATUSDATA stsdata; stsdata.Length = sizeof(stsdata); stsdata.SelectInd = SET_SESSION_NON_SELECTABLE; /* Non-selectable */ stsdata.BondInd = SET_SESSION_UNCHANGED; /* Leaves session bonding */ /* index unchanged */ DosSetSession(ulSessionID, &stsdata);
Once a child session is made nonselectable, the user cannot select the session from the Window List or move to it by using the Alt+Esc keys. However, the parent session can still bring the child session to the foreground by using DosSelectSession. If the session contains a Presentation Manager application or is a windowed session, the user will still be able to select it with a mouse.
The parent session can make a nonselectable child session selectable by setting the SelectInd field to SET_SESSION_SELECTABLE in the STATUSDATA structure. DosSetSession can be called only by a parent session and only for a child session. That is, the calling process must be the process that started the child session using DosStartSession. Neither the parent session itself nor any grandchild, nor any other descendant session beyond a child session can be the target of this call.
Additionally, DosSetSession cannot be used to change the status of a session that was started as an unrelated session. The Related field in the STARTDATA structure must have been set to 1 when the session was started.