Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!decwrl!borland.com!ejs From: ejs@borland.com (Eric Swenson) Newsgroups: comp.windows.ms.programmer Subject: Re: Enumerate Tasks Message-ID: <1991May29.001621.6877@borland.com> Date: 29 May 91 00:16:21 GMT References: <1276198232@p4.f36.n245.z2.fidonet.org> Organization: Borland International Lines: 17 In article <1276198232@p4.f36.n245.z2.fidonet.org> Norbert_Unterberg%p4.f36.n245.z2@hippo.dfv.rwth-aachen.de (Norbert Unterberg) writes: >Does anybody know if there is a way to get the task handles of all running >tasks? Maybe a function like EnumTasks (which doesn't exist). Windows has >functions like GetNumTasks() and GetCurrentTask(), but how can I get task >handles (or other task info) of all that tasks? There must be a way, because >HEAPWALK knows about the tasks! Well, the Task Manager does not, it only >displays the titles of all overlapped windows... In Windows 3.0, you have to use undocumented means to get the list of running tasks. (You use GETTASKQUEUE and follow the chain of linked TDBs until you get a null pointer). For Windows 3.1, you can use the new TOOLHELP DLL which gives you an entrypoint to enumerate all the tasks. TOOLHELP is available as part of the OpenTools program and the current version runs fine under Windows 3.0. This is the MS-recommended way to do what you want. -- Eric Swenson (ejs@borland.com)