🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Spawning and controlling

#4907
From: Bob Gonder
Date: Fri, 11 Nov 2005 16:11
18 lines
1466 bytes
Denville Longhurst wrote:

>1. Check whether foo.exe is already running so that I don't attempt to run 
>it twice;

Use acess() to check if the file is writable.
When the program is running, it is not writable.
If the file is marked as read-only, or resides on a CD, then this
method will fail.

>2. Spawn foo.exe

Use CreateProcess()

>4. From my app, terminate foo.exe

CreateProcess() returns handles that can be used to terminate the
process.
Technical Details
Message-ID: <81g9n1tnc4hn71lnsbge6ie8osgd9mpluv@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!easynet-monga!easynet.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <4374b248$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d85ed3b722a8f188
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Spawning and controlling
Date: Fri, 11 Nov 2005 08:11:55 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <81g9n1tnc4hn71lnsbge6ie8osgd9mpluv@4ax.com>
References: <4374b248$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 71.0.35.131
X-Trace: newsgroups.borland.com 1131725482 71.0.35.131 (11 Nov 2005 08:11:22 -0700)
Lines: 20
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!easynet-monga!easynet.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail