Article View: borland.public.cppbuilder.nativeapi
Article #1355Re: WM_COPYDATA problem
From: Damon Chandler (TeamB)
Date: Mon, 03 Sep 2007 06:44
Date: Mon, 03 Sep 2007 06:44
30 lines
1927 bytes
1927 bytes
Hi,
You're catching the WM_COPYDATA in your TFormMain class, but you're
sending the message to the window whose handle is returned via the
following call...
HWND hWnd = FindWindow("TApplication", "MutexTest");
I don't believe the above call is returning the correct handle. You
should replace "TApplication" with "TFormMain" and adjust the second
parameter to the form's caption.
As a side note, there's no need to use the WindowProc property since you
can override the WndProc() method directly.
Cheers,
--
Damon Chandler (TeamB)
C++Builder Developer's Journal
http://bcbjournal.com
http://bcbjournal.org
anon5 wrote:
> Hey guys
>
> I am trying to create a 'once-only' app (only one instance can run).
[snip 8<----]
> Now, the once-only aspect of the app works great. But my WM_COPYDATA
> message isn't being picked up at all. If anyone can help at all it would
> be fantastic. Thanks!
Technical Details
Message-ID:
<46dbad32$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<46db6544$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ae849346afde0161 X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Mon, 03 Sep 2007 01:44:33 -0500 From: "Damon Chandler (TeamB)" <editor@NOSPAM.bcbjournal.com> User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: WM_COPYDATA problem References: <46db6544$1@newsgroups.borland.com> In-Reply-To: <46db6544$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 139.78.77.231 Message-ID: <46dbad32$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1188801842 139.78.77.231 (2 Sep 2007 23:44:02 -0700) Lines: 30 Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail X-Original-Bytes: 1777