This example creates a task-list entry for program name "Generic: NEW.APP".

#define INCL_WINSWITCHLIST      /* Window Switch List Functions */
#define INCL_WINWINDOWMGR       /* Window Manager Functions     */

#include <os2.h>

HSWITCH hswitch;        /* task-list entry handle               */
SWCNTRL swctl;          /* switch-control data                  */
PID pid;                /* process id                           */
HAB hab;                /* anchor-block handle                  */
HWND hwndFrame;         /* frame handle                         */

hab = WinQueryAnchorBlock(hwndFrame);      /* gets anchor block */
WinQueryWindowProcess(hwndFrame, &pid, NULL);/* gets process id */

/* initialize switch structure */
swctl.hwnd = hwndFrame;                   /* window handle      */
swctl.hwndIcon = NULLHANDLE;              /* icon handle        */
swctl.hprog = NULLHANDLE;                 /* program handle     */
swctl.idProcess = pid;                    /* process identifier */
swctl.idSession = 0;                      /* session identifier */
swctl.uchVisibility = SWL_VISIBLE;        /* visibility         */
swctl.fbJump = SWL_JUMPABLE;              /* jump indicator     */
strcpy(swctl.szSwtitle,"Generic: NEW.APP"); /* program name     */

hswitch = WinCreateSwitchEntry(hab, &swctl);


[Back] [Next]