From: SMTP%"prasad@ns2.cybermedia.com" 3-OCT-1997 17:03:30.09 To: Arnab Bhaduri CC: Subj: RE: process by name Return-Path: owner-ntdev@atria.com Received: by arisia.gce.com (UCX V4.1-12C, OpenVMS V7.1 VAX); Fri, 3 Oct 1997 16:58:26 -0400 Received: from gw.atria.com (gw.atria.com [192.88.237.2]) by bort.mv.net (8.8.5/mem-951016) with SMTP id IAA06210 for ; Fri, 3 Oct 1997 08:49:45 -0400 (EDT) Received: by gw.atria.com id Fri, 3 Oct 1997 03:02:58 -0400 Received: from cybermedia.com by gw.atria.com id Fri, 3 Oct 1997 03:02:55 -0400 Received: from localhost (prasad@localhost) by cybermedia.com (8.7.5/8.7.3) with SMTP id AAA14331; Fri, 3 Oct 1997 00:05:15 -0700 Date: Fri, 3 Oct 1997 00:05:15 -0700 (PDT) From: "Prasad S. Dabak" To: Arnab Bhaduri cc: "'Brandon Jackson'" , "'ntdev@atria.com'" Subject: RE: process by name In-Reply-To: <01BCCF5E.8DB11740@arnab.hcla.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-ntdev@atria.com Precedence: bulk Hi, NT 4.0 SDK comes with one DLL called PSAPI.DLL This DLL provides functions for enumerating processes, getting anmes of processes etc. There is header file also available called PSAPI.H which documents this function. This is a more simple way than the registry approach as the information in registry is stored in a complex way in performance data. -Prasad PS: PSAPI.DLL uses native NT system serivices to get the data. On Thu, 2 Oct 1997, Arnab Bhaduri wrote: > > You need to go through the performance data in > the registry. First you need to retrieve the > performance data, then scan through the data > and extract the process objects, then match the > names of the process objects with the name of > the process you are looking for. Once you find > the desired process, you can open a handle to > the process and then terminate it. Keep in mind- > (a) necessary privileges are required to kill the > process (b) the performance object keeps only the > name of the process executable and not the > extension. > > Look in the PVIEWER sample in MSDN for details on > how to access performance data. I have some code > that does something similar (hacked from the PVIEWER > sample) - if you want a look at it email me and > I'll send it along. > > Hope this helps. > Arnab > > ---------- > From: Brandon Jackson[SMTP:brandon.jackson@macsch.com] > Sent: Thursday, October 02, 1997 8:54 AM > To: 'NTDEV List' > Subject: process by name > > Q: How can you get the process id of a process thru it's name. > > Bkgrnd: We create a process which is A.exe it in turn creates > another process and runs B.exe. When we start A.exe, we are > returned its pid. When the user hits Cancel we can stop A.exe, > but we can't get at B.exe because we have no pid. Both A.exe > and B.exe are not our programs, so we can't change them. > > TIA > Brandon > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > [ To unsubscribe, send email to ntdev-request@atria.com with body > UNSUBSCRIBE (the subject is ignored). ] > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntdev-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ]