Article View: borland.public.cppbuilder.nativeapi
Article #11777Re: Terminating An EXE
From: Rodolfo Frino - Macrosoft
Date: Wed, 14 Jan 2004 04:09
Date: Wed, 14 Jan 2004 04:09
32 lines
1674 bytes
1674 bytes
Use sendMessage() API to send the WM_CLOSE message to the
process you want to terminate. For example:
HWND hWindow = FindWindow(NULL, "Terminator");
if (hWindow)
SendMessage(hWindow, WM_CLOSE, 0, 0);
else
ShowMessage("FindWindow failed"); // or any other error function or
throw exception
Rodolfo
"CBoss" <arifcimen@prowise.com.tr> wrote in message
news:40042f84@newsgroups.borland.com...
> Hi all,
>
> How can I terminate a program (exe) in code.
>
> For example the program I want to terminate is "TEST.exe",
>
> And the program I want to terminate "TEST.exe" in is "Terminator.exe".
>
> What is the code I need in "Terminator.exe".
>
> Thanks A Lot,
>
> Arif.
>
>
>
Technical Details
Message-ID:
<4004c10a@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-hog.berkeley.edu!ucberkeley!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<40042f84@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,b7295d63393a6959 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-01-13 20:29:41 PST From: "Rodolfo Frino - Macrosoft" <Microhaven@Atlantis.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <40042f84@newsgroups.borland.com> Subject: Re: Terminating An EXE Date: Wed, 14 Jan 2004 15:09:46 +1100 Lines: 34 Organization: Microhaven X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 203.206.20.67 Message-ID: <4004c10a@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1074053386 203.206.20.67 (13 Jan 2004 20:09:46 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-hog.berkeley.edu!ucberkeley!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail