win12.hlp (Table of Contents; Topic list)
WinQuerySessionTitle (1.2)
Overview                                            Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINSWITCHLIST
 
USHORT WinQuerySessionTitle(hab, usSession, pszTitle, cbTitle)
HAB hab;             /* anchor-block handle         */
USHORT usSession;    /* screen session              */
PSZ pszTitle;        /* pointer to buffer for title */
USHORT cbTitle;      /* buffer length               */
 
The WinQuerySessionTitle function retrieves the title under which a
specified application was started or added to the Task List.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hab        Identifies the anchor block.
 
usSession  Specifies the screen session. For MS OS/2 version 1.2, this value
           may be 0 or 1; 0 means the screen session of the caller.
 
pszTitle   Points to the buffer that receives the null-terminated string
           that specifies the application's title.
 
cbTitle    Specifies the length (in bytes) of the buffer pointed by
           pszTitle. If the title string is longer than this length, the
           title will be truncated.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be the following:
 
    PMERR_INVALID_SESSION_ID
 
Comments
 
The length of the title is guaranteed not to exceed MAXNAMEL bytes, plus one
for the null-terminating character. (MAXNAMEL is defined in the MS OS/2
include files.)
 
Example
 
This example calls WinQuerySessionTitle to retrieve the application's title,
and then sets the title bar of the frame window to that title.
 
CHAR szTitle[MAXNAMEL + 1];
 
WinQuerySessionTitle(hab, 0, szTitle, sizeof(szTitle));
WinSetWindowText(hwndFrame, szTitle);
 
See Also
 
WinSetWindowText