🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Continuing problem with SendMessage and WM_CCOPYDATA

#4279
From: Alan Bellingham
Date: Tue, 28 Feb 2006 18:00
23 lines
1804 bytes
"JD" <nospam@nospam.com> wrote:

>That block of code only executes if another instance of the
>application is already running:
>
>    if ( GetLastError() == ERROR_ALREADY_EXISTS )
>      {
>         HWND MainFormHWnd = FindWindow( "TMyApplicationMainForm", NULL );
>         ....
>      }
>
>How can you be sure that FindWindow returns the first instance
>v/s the instance in which that block is executing?

Very easily - after all, the second and subsequent instances know that
there should only be one instance. Therefore, when they detect the first
instance already exists, they don't create the window.

I assume you know how not to create a window?

Alan Bellingham
-- 
ACCU Conference 2006 - 19-22 April, Randolph Hotel, Oxford, UK
Technical Details
Message-ID: <ol3902lof67seol05pvj19ojs29bocfd5c@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <44021981$1@newsgroups.borland.com> <44024219$1@newsgroups.borland.com> <44046dac$1@newsgroups.borland.com> <4404752a$1@newsgroups.borland.com> <44048bdc$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6afbc9bf5041d787
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Alan Bellingham <alanb@episys.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Continuing problem with SendMessage and WM_CCOPYDATA
Date: Tue, 28 Feb 2006 18:00:52 +0000
Reply-To: alanb@episys.com
Message-ID: <ol3902lof67seol05pvj19ojs29bocfd5c@4ax.com>
References: <44021981$1@newsgroups.borland.com> <44024219$1@newsgroups.borland.com> <44046dac$1@newsgroups.borland.com> <4404752a$1@newsgroups.borland.com> <44048bdc$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 3.1/32.783
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 193.129.251.253
X-Trace: newsgroups.borland.com 1141149651 193.129.251.253 (28 Feb 2006 10:00:51 -0700)
Lines: 23
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail