This example calls WinQuerySwitchHandle to get the Task List handle of a frame window, and then calls WinQuerySwitchEntry to retrieve information about that application.
#define INCL_WINSWITCHLIST #include <OS2.H> HAB hab; HWND hwndFrame; HSWITCH hswitch; SWCNTRL swctl; hswitch = WinQuerySwitchHandle(hwndFrame, 0); WinQuerySwitchEntry(hswitch, &swctl);