🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #11778

Re: Terminating An EXE

#11778
From: Rodolfo Frino - Macrosoft
Date: Wed, 14 Jan 2004 04:41
44 lines
1995 bytes
In your case it will probably be

HWND hWindow = FindWindow(NULL, "Test");

... and the rest of the previous code

Rodolfo

"Rodolfo Frino - Macrosoft" <Microhaven@Atlantis.com> wrote in message
news:4004c10a@newsgroups.borland.com...
> 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: <4004c876@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40042f84@newsgroups.borland.com> <4004c10a@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 21:09:44 PST
From: "Rodolfo Frino - Macrosoft" <Microhaven@Atlantis.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <40042f84@newsgroups.borland.com> <4004c10a@newsgroups.borland.com>
Subject: Re: Terminating An EXE
Date: Wed, 14 Jan 2004 15:41:23 +1100
Lines: 46
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: <4004c876@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1074055286 203.206.20.67 (13 Jan 2004 20:41:26 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail