DosSelectSession (OS/2 1.x)

This call allows a parent session to switch one of its child sessions to the foreground.

Syntax
DosSelectSession (SessID, Reserved)

Parameters

 * SessID (USHORT) - input : ID of the session to be switched to the foreground. The values are their meanings are:
 * 0 - Switch the caller (the parent session) to the foreground.
 * <> 0 - Switch the child session to the foreground.
 * The nonzero value specified for SessID must have been returned by a previous DosStartSession request.


 * Reserved (ULONG) - input : A DWord of 0.

Return Code

 * rc (USHORT) - return:Return code descriptions are:
 * 0 NO_ERROR
 * 369 ERROR_SMG_INVALID_SESSION_ID
 * 418 ERROR_SMG_INVALID_CALL
 * 451 ERROR_SMG_SESSION_NOT_FOREGRND
 * 452 ERROR_SMG_SESSION_NOT_PARENT
 * 459 ERROR_SMG_BAD_RESERVE

Remarks
DosSelectSession can be issued by a parent session to select only itself or a child session. It cannot be used to select a grandchild session. The child session must have been started by the caller with a request to DosStartSession, specifying "Related = 1." Sessions started as independent sessions cannot be selected with this call.

When DosSelectSession is issued, the session is brought to the foreground only if the parent session or one of its descendant sessions is executing in the foreground. Otherwise, ERROR_SMG_SESSION_NOT_FOREGRND is returned.

C

 * 1) define INCL_DOSSESMGR

USHORT rc = DosSelectSession(SessID, Reserved);

USHORT SessID;        /* Session ID */ ULONG  0;             /* Reserved (must be zero) */

USHORT rc;            /* return code */ 

MASM
 EXTRN DosSelectSession:FAR INCL_DOSSESMGR     EQU 1

PUSH  WORD    SessID        ;Session ID PUSH   DWORD   0             ;Reserved (must be zero) CALL  DosSelectSession

Returns WORD 