Article View: borland.public.cppbuilder.nativeapi
Article #1443Re: How to terminate another program from my application?
From: Dennis Jones
Date: Sun, 26 Aug 2007 21:31
Date: Sun, 26 Aug 2007 21:31
18 lines
1685 bytes
1685 bytes
"Michel Corbin" <"Michel Corbin"> wrote in message news:46d1deff@newsgroups.borland.com... > Hi! > > HANDLE hd=GetCurrentProcess() ; That won't work for *another* application (the OP asked how to get the handle of another application given only its name). The following article on MSDN should help: http://msdn2.microsoft.com/en-us/library/ms682623.aspx It uses EnumProcesses and GetModuleBaseName (both of which are available in the process status API, psapi) to display the name of currently executing processes in the system. - Dennis
Technical Details
Message-ID:
<46d1f127$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!194.25.134.62.MISMATCH!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<46d17858@newsgroups.borland.com> <46d19c99$1@newsgroups.borland.com> <46d1dde9@newsgroups.borland.com> <46d1deff@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ea27fed4f668a6eb X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Dennis Jones" <nospam@nospam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <46d17858@newsgroups.borland.com> <46d19c99$1@newsgroups.borland.com> <46d1dde9@newsgroups.borland.com> <46d1deff@newsgroups.borland.com> Subject: Re: How to terminate another program from my application? Date: Sun, 26 Aug 2007 14:31:21 -0700 Lines: 20 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 71.245.109.58 Message-ID: <46d1f127$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1188163879 71.245.109.58 (26 Aug 2007 14:31:19 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!194.25.134.62.MISMATCH!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail