Article View: borland.public.cppbuilder.nativeapi
Article #17119Re: ShellExecute
From: nicolasr
Date: Thu, 10 Apr 2003 01:48
Date: Thu, 10 Apr 2003 01:48
14 lines
1683 bytes
1683 bytes
Hi Remy, > > is there a way to get process IDs from process handles? > > None that I know of. I just tested to launch a program with ShellExecute() and close it with TerminateProcess() which needs the process handle. I used FindWindow() to get the handle of the programs window, then GetWindowThreadProcessId() to obtain the process ID. Then I stumbled across the OpenProcess() API and this seems to return the process handle. At least the call to TerminateProcess() worked... Nick
Technical Details
Message-ID:
<3e94cd3c$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3e8c0ea4@newsgroups.borland.com> <3e8c5793$1@newsgroups.borland.com> <3e8c5dce@newsgroups.borland.com> <3e8c7d44@newsgroups.borland.com> <3e8c8d8f$1@newsgroups.borland.com> <3e8c9481$1@newsgroups.borland.com> <3e8ca60e$2@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,bff1fa0e8e8777f2 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-04-09 18:53:08 PST From: "nicolasr" <nicolasrNOSPAMATSIGNgmx.net> Newsgroups: borland.public.cppbuilder.nativeapi References: <3e8c0ea4@newsgroups.borland.com> <3e8c5793$1@newsgroups.borland.com> <3e8c5dce@newsgroups.borland.com> <3e8c7d44@newsgroups.borland.com> <3e8c8d8f$1@newsgroups.borland.com> <3e8c9481$1@newsgroups.borland.com> <3e8ca60e$2@newsgroups.borland.com> Subject: Re: ShellExecute Date: Thu, 10 Apr 2003 03:48:09 +0200 Lines: 17 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 80.133.173.79 Message-ID: <3e94cd3c$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1049939260 80.133.173.79 (9 Apr 2003 18:47:40 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail