TaskFirst

3.1

  #include <toolhelp.h>    

  BOOL TaskFirst(lpte)    
  TASKENTRY FAR* lpte; /* address of TASKENTRY structure */

The TaskFirst function fills the specified structure with information about the first task on the task queue.

Parameters

lpte

Points to a TASKENTRY structure to receive information about the first task. The TASKENTRY structure has the following form:

#include <toolhelp.h>

typedef struct tagTASKENTRY {  /* te */
    DWORD     dwSize;
    HTASK     hTask;
    HTASK     hTaskParent;
    HINSTANCE hInst;
    HMODULE   hModule;
    WORD      wSS;
    WORD      wSP;
    WORD      wStackTop;
    WORD      wStackMinimum;
    WORD      wStackBottom;
    WORD      wcEvents;
    HGLOBAL   hQueue;
    char      szModule[MAX_MODULE_NAME + 1];
    WORD      wPSPOffset;
    HANDLE    hNext;
} TASKENTRY;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

Return Value

The return value is nonzero if the function is successful. Otherwise, it is zero.

Comments

The TaskFirst function can be used to begin a walk through the task queue. An application can examine subsequent entries in the task queue by using the TaskNext function.

Before calling TaskFirst, an application must initialize the TASKENTRY structure and specify its size, in bytes, in the dwSize member.

See Also

TaskFindHandle, TaskNext