🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Continuing problem with SendMessage and WM_CCOPYDATA

#4278
From: JD
Date: Tue, 28 Feb 2006 16:43
22 lines
1563 bytes
"Dennis Jones" <nospam@nospam.com> wrote:
>
>> I have a problem with this line because you could get the
>> wrong instance.
>
> Wait...if you can only have one instance running, then how
> could you possibly get the wrong instance?

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?

~ JD
Technical Details
Message-ID: <44048bdc$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!peer01.west.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!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>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6afbc9bf5041d787
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "JD" <nospam@nospam.com>
Sender: "JD" <nospam@nospam.com>
Reply-To: "JD" <nospam@nospam.com>
Subject: Re: Continuing problem with SendMessage and WM_CCOPYDATA
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 152.163.100.201     
X-Forwarded-For: 172.154.132.168
References: <44021981$1@newsgroups.borland.com> <44024219$1@newsgroups.borland.com> <44046dac$1@newsgroups.borland.com> <4404752a$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <44048bdc$1@newsgroups.borland.com>
Date: 28 Feb 2006 09:43:56 -0700
X-Trace: newsgroups.borland.com 1141148636 207.105.83.66 (28 Feb 2006 09:43:56 -0700)
Lines: 23
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!peer01.west.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail