Article View: borland.public.cppbuilder.nativeapi
Article #2657Re: WinExec and multiple istances
From: Alberto
Date: Thu, 25 Jan 2007 19:52
Date: Thu, 25 Jan 2007 19:52
23 lines
1536 bytes
1536 bytes
DavideP wrote:
> Hi everyone,
> I've a little question.
>
> I need to display a logfile of a program of mine, so I use:
> WinExec('Notepad.exe C:\Temp\MyFile.txt', SW_SHOWDEFAULT);
> on a OnClick event of a button.
>
> It works well, but... by clicking several times on it I've found
> multiple istances of Notepad opened...
> How can I avoid this feature?
> I need only one instance of notepad with my logfile.
>
> Many thanks for the help.
>
> Davide
>
Just set a flag in your program... if WinExec has already been called,
ignore
the second pressure on that button.
You can reset that flag when the Notepad process terminates.
Alberto
Technical Details
Message-ID:
<45b90a4b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<45b793fe@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,21a207d706a45f41 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 25 Jan 2007 20:52:28 +0100 From: Alberto <dibene@usa.net> User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: WinExec and multiple istances References: <45b793fe@newsgroups.borland.com> In-Reply-To: <45b793fe@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 151.46.167.60 Message-ID: <45b90a4b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1169754699 151.46.167.60 (25 Jan 2007 11:51:39 -0800) Lines: 23 Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail