Article View: borland.public.cppbuilder.nativeapi
Article #10773Re: Obtaining process id
From: Chris Val
Date: Thu, 25 Mar 2004 00:27
Date: Thu, 25 Mar 2004 00:27
23 lines
1970 bytes
1970 bytes
"Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> wrote in message news:<4061cf64$1@newsgroups.borland.com>... > "Chris ( Val )" <chrisval@bigpond.com.au> wrote in message > news:40619ba9@newsgroups.borland.com... > > > My ultimate goal is to find out which application > > is locking a particular file, and log the process id > > and the offending application(exe) name into the > > database for further analysis. > > What you ask for is not provided by the Win32 API at all. You have to drop > down to a lower level and query the kernel directly, which is not a simple > task. What you ask for is possible in genernal, though, as demonstrated by > the "Process Explorer" and "Handle" utilities at http://www.sysinternals.com Thanks for the help Remy - that would explain why I could not find anything in the API to do it - I will have a search for some assembly code and see if I can work something out. Oh, I already knew about the sysinternals tools - I have used them before, but thanks for the suggestion in any case. Cheers. Chris Val
Technical Details
Message-ID:
<118880b0.0403241627.700b82d@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews2.google.com!not-for-mailReferences:
<40619ba9@newsgroups.borland.com> <4061cf64$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,8f802efbcb83e75e X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-03-24 16:27:09 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews2.google.com!not-for-mail From: chrisval@bigpond.com.au (Chris Val) Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Obtaining process id Date: 24 Mar 2004 16:27:08 -0800 Organization: http://groups.google.com Lines: 23 Message-ID: <118880b0.0403241627.700b82d@posting.google.com> References: <40619ba9@newsgroups.borland.com> <4061cf64$1@newsgroups.borland.com> NNTP-Posting-Host: 203.89.239.218 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1080174428 1672 127.0.0.1 (25 Mar 2004 00:27:08 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 25 Mar 2004 00:27:08 +0000 (UTC)