DosStartSession allows an application to start another session, and to specify the name of the program to be started in that session.

A session can be thought of as a logical console, consisting of buffers for the screen, keyboard, and mouse.

New sessions may only be started in the foreground when the caller's session (or one of the caller's descendant sessions) is currently executing in the foreground. The foreground session for windowed applications is the session of the application that owns the window focus. The new session appears in the Shell switch list.

Any protect-mode application may start any other protect-mode application in a new session, regardless of the issuing program's session type.

You may use DosExecPgm to start a process that is of the same type as the starting process. Process types include Presentation Manager, text-windowed, and full-screen. You may not use DosExecPgm to start a process that is of a different type than the starting process.

You must use DosStartSession to start a new process from a process that is of a different type. For example, use DosStartSession to start a Presentation Manager process from a non-Presentation Manager process.

If you call DosStartSession from a detached process, the function returns ERROR_SMG_INVALID_CALL. This happens regardless of whether the session is to be started in the foreground or in the background. Detached processes are programs that:

Detached processes are started when: