TaskFindHandle

3.1

  #include <toolhelp.h>    

  BOOL TaskFindHandle(lpte, htask)    
  TASKENTRY FAR* lpte; /* address of TASKENTRY structure */
  HTASK htask; /* handle of task, */  

The TaskFindHandle function fills the specified structure with information that describes the given task.

Parameters

lpte

Points to a TASKENTRY structure to receive information about the 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.

htask

Identifies the task to be described.

Return Value

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

Comments

The TaskFindHandle 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 TaskFindHandle, an application must initialize the TASKENTRY structure and specify its size, in bytes, in the dwSize member.

See Also

TaskFirst, TaskNext