🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: launching separate program

#9147
From: Ted Lyngmo
Date: Wed, 28 Jul 2004 17:18
17 lines
1541 bytes
Blake Young wrote:
 >
 > I want to be able to call an application and
 > have it live separately from the calling program. I don't want to wait for
 > it to end and then close the handle and thread, I need to just launch it and
 > then forget about it.

Just remove WaitForSingleObject() and close the handles right after a 
successful call to CreateProcess().

if( CreateProcess(...) ) {
     CloseHandle( pi.hProcess );
     CloseHandle( pi.hThread );
}

Kind regards,
Ted Lyngmo
Technical Details
Message-ID: <4107deda$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4107c722$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4306aa7d734acfa6
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 28 Jul 2004 19:18:58 +0200
From: Ted Lyngmo <MY_FIRST_NAME@lyncon.se>
Organization: Lyncon - Computer & Music consulting
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: sv,en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: launching separate program
References: <4107c722$1@newsgroups.borland.com>
In-Reply-To: <4107c722$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 82.182.114.26
Message-ID: <4107deda$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1091034842 82.182.114.26 (28 Jul 2004 10:14:02 -0700)
Lines: 18
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail