🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: To Kill A Process

#2205
From: Remy Lebeau (TeamB)
Date: Fri, 23 Mar 2007 03:48
28 lines
1955 bytes
"poojo hackma" <poojo.com/mail> wrote in message
news:45c257c5$1@newsgroups.borland.com...

> If AutoRun.exe can detect that CustomSetup.exe is
> running, it can close CustomSetup.exe ... or itself.

Have both CustomSetup.exe and AutoRun.exe (and optionally MainApp.exe
as well) create a mutex with the same name when run, and release it on
exit.  GetLastError() will return whether the mutex already existed or
not.  This way, CreateSetup.exe can detect whether AutoRun.exe is
already running, and vice versa.

> I'd like to use EnumWindows and GetWindowThreadProcessId
> within AutoRun.exe to find and close CustomSetup.exe
> (using WM_CLOSE)
>
> How can I find the CustomSetup.exe process?

You don't need to.  Just have AutoRun.exe (and MainApp.exe) exit if it
detects that CustomSetup.exe is already running.  Maybe
CustomSetup.exe is installing a new version of AutoRun.exe and
MainApp.exe (or recovering a previous install), so they shouldn't be
running in that situation so that CustomSetup.exe can overwrite the
files.


Gamit
Technical Details
Message-ID: <46034137$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45c257c5$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,122949c7220b533e
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <45c257c5$1@newsgroups.borland.com>
Subject: Re: To Kill A Process
Date: Thu, 22 Mar 2007 19:48:25 -0800
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 75.83.34.171
Message-ID: <46034137$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1174618423 75.83.34.171 (22 Mar 2007 19:53:43 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail