Difference between revisions of "DosSelectSession"

From EDM2
Jump to: navigation, search
m
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
==DosSelectSession==
+
DosSelectSession lets a parent session switch one of its child sessions or itself to the foreground, no grandchild session or any other descendant beyond a child session can be selected.
  
 +
==Syntax==
 +
DosSelectSession ( ulIDSession )
  
===Syntax===
+
==Parameters==
 +
;ulIDSession (ULONG) - input:The ID of the session to be switched to the foreground.
  
rc = DosSelectSession( ''ulIDSession'' );
+
==Returns==
 +
;rc (APIRET) - return
 +
:0  NO_ERROR
 +
:224 ERROR_SMG_NO_TARGET_WINDOW
 +
:369 ERROR_SMG_INVALID_SESSION_ID
 +
:418 ERROR_SMG_INVALID_CALL
 +
:459 ERROR_SMG_BAD_RESERVE
 +
:460 ERROR_SMG_PROCESS_NOT_PARENT
 +
:463 ERROR_SMG_RETRY_SUB_ALLOC
  
===Parameters===
+
==Usage Explanation==
 
+
The child process will not be brought to the foreground unless the parent session or one of its descendant sessions is currently executing in the foreground. For windowed applications is the application that owns the window focus the foreground session. It is only possible to issue DosSelectSession on sessions started by the current session with DosStartSession, with Related set to SSF_RELATED_CHILD (=1).
; ULONG ''ulIDSession'' (input)
+
: The ID of the session to be switched to the foreground.
+
 
+
===Returns===
+
 
+
+
APIRET  rc
+
0      NO_ERROR
+
224    ERROR_SMG_NO_TARGET_WINDOW
+
369    ERROR_SMG_INVALID_SESSION_ID
+
418    ERROR_SMG_INVALID_CALL
+
459    ERROR_SMG_BAD_RESERVE
+
460    ERROR_SMG_PROCESS_NOT_PARENT
+
463    ERROR_SMG_RETRY_SUB_ALLOC
+
 
+
===Include Info===
+
 
+
#define INCL_DOSSESMGR
+
#include <os2.h>
+
 
+
===Usage Explanation===
+
 
+
DosSelectSession lets a parent session switch one of its child sessions or itself to the foreground, no grandchild session or any other descendant beyond a child session can be selected. The child process will not be brought to the foreground unless the parent session or one of its descendant sessions is currently executing in the foreground. For windowed applications is the application that owns the window focus the foreground session. It is only possible to issue DosSelectSession on sessions started by the current session with DosStartSession, with Related set to SSF_RELATED_CHILD (=1).
+
 
+
===Relevant Structures===
+
 
+
===Gotchas===
+
 
+
===Sample Code===
+
  
 +
==Sample Code==
 +
<code>
 
  #define INCL_DOSSESMGR
 
  #define INCL_DOSSESMGR
 
  #include <os2.h>
 
  #include <os2.h>
Line 47: Line 31:
 
  /* DosStartSession(psd,&ulIDSession,..); */  
 
  /* DosStartSession(psd,&ulIDSession,..); */  
 
   
 
   
  if(DosSelectSession(ulIDSession)) /* Switch child session to foreground */
+
  if(DosSelectSession(ulIDSession)) /* Switch child session to foreground */
 
  {
 
  {
 
     /* Problems */
 
     /* Problems */
Line 55: Line 39:
 
     /* The child session is now in the foreground */
 
     /* The child session is now in the foreground */
 
  }
 
  }
 +
</code>
  
===See Also===
+
==See Also==
 
+
*[[DosStartSession]]
[[OS2 API:DosStartSession|DosStartSession]], [[OS2 API:DosStopSession|DosStopSession]], [[OS2 API:DosSetSession|DosSetSession]]
+
*[[DosStopSession]]
 +
*[[DosSetSession]]
  
[[Category:The OS/2 API Project]]
+
[[Category:Dos]]

Latest revision as of 09:44, 12 October 2018

DosSelectSession lets a parent session switch one of its child sessions or itself to the foreground, no grandchild session or any other descendant beyond a child session can be selected.

Syntax

DosSelectSession ( ulIDSession )

Parameters

ulIDSession (ULONG) - input
The ID of the session to be switched to the foreground.

Returns

rc (APIRET) - return
0 NO_ERROR
224 ERROR_SMG_NO_TARGET_WINDOW
369 ERROR_SMG_INVALID_SESSION_ID
418 ERROR_SMG_INVALID_CALL
459 ERROR_SMG_BAD_RESERVE
460 ERROR_SMG_PROCESS_NOT_PARENT
463 ERROR_SMG_RETRY_SUB_ALLOC

Usage Explanation

The child process will not be brought to the foreground unless the parent session or one of its descendant sessions is currently executing in the foreground. For windowed applications is the application that owns the window focus the foreground session. It is only possible to issue DosSelectSession on sessions started by the current session with DosStartSession, with Related set to SSF_RELATED_CHILD (=1).

Sample Code

#define INCL_DOSSESMGR
#include <os2.h>

ULONG ulIDSession; 

/* Start a child session with DosStartSession */
/* psd->Related=SSF_RELATED_CHILD; */
/* DosStartSession(psd,&ulIDSession,..); */ 

if(DosSelectSession(ulIDSession)) /* Switch child session to foreground */
{
    /* Problems */
}
else
{
    /* The child session is now in the foreground */
}

See Also