Article View: borland.public.cppbuilder.nativeapi
Article #2655Re: WinExec and multiple istances
From: Remy Lebeau (TeamB)
Date: Wed, 24 Jan 2007 18:14
Date: Wed, 24 Jan 2007 18:14
31 lines
1947 bytes
1947 bytes
"DavideP" <no.spam@here.plz> wrote in message news:45b793fe@newsgroups.borland.com... > by clicking several times on it I've found multiple istances of Notepad opened... As you should be. That is how WinExec() works - it creates a new process each time it is called. > How can I avoid this feature? You can't. Notepad is not designed for that, and there is nothing WinExec() (or CreateProcess(), for that matter) can do about it. The called program, not the calling program, controls how the file is loaded. If the called program does not want to run multiple instances, then it has to control that on its own. The calling program has no say in that matter. > I need only one instance of notepad with my logfile. Then I suggest you not use Notepad at all. Display the log in your own UI, such as in a TMemo or TRichEdit control.. Then you have full control over it. If you must use an external program, then write your own. Then it can avoid multiple instances of itself. It is a very common feature to implement, so there are plenty of examples floating around to look at. Gambit
Technical Details
Message-ID:
<45b7a207$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.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 From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <45b793fe@newsgroups.borland.com> Subject: Re: WinExec and multiple istances Date: Wed, 24 Jan 2007 10:14:53 -0800 Lines: 34 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: <45b7a207$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1169662471 75.83.34.171 (24 Jan 2007 10:14:31 -0800) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail