🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Continuing problem with SendMessage and WM_CCOPYDATA

#4272
From: Remy Lebeau (TeamB)
Date: Mon, 27 Feb 2006 21:17
41 lines
2215 bytes
"Nate" <RNLockwood@attglobal.net> wrote in message
news:44035e7c$1@newsgroups.borland.com...

> The receiver addess is the handle to the application but
> the receiver code is in the main form - does this matter?

Yes!  That is what I keep explaining to you.  You are not handling the
message from the context of the window that actually receives it.

> What should SendMessage return on success?

Whatever the receiver of the message returns.  Messages have a return value
of 0 by default.  You should have your message handler explicitally set the
result to TRUE.  The Win32 API documentation even says as much:

    "If the receiving application processes this message, it should return
TRUE; otherwise, it should return FALSE. "

Then, in the process that is sending the message, you can check the message
result to make sure that it was actually processed.  For example:

    if( Message.Msg == WM_COPYDATA )
    {
        //...
        if( ... is my message ... )
        {
            //...
            Message.Result = TRUE;
        }
        //...
    }


    if( ::SendMessage(hReceiver, WM_COPYDATA, ...) == TRUE )
        // message was processed ...
    else
        // message was not processed ...


Gambit
Technical Details
Message-ID: <44036c42$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news1.google.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <44021981$1@newsgroups.borland.com> <2f36029db0t6k0taqhpch04dcvrm1832e5@4ax.com> <44035e7c$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: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <44021981$1@newsgroups.borland.com> <2f36029db0t6k0taqhpch04dcvrm1832e5@4ax.com> <44035e7c$1@newsgroups.borland.com>
Subject: Re: Continuing problem with SendMessage and WM_CCOPYDATA
Date: Mon, 27 Feb 2006 13:17:42 -0800
Lines: 43
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: 68.69.17.41
Message-ID: <44036c42$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1141075010 68.69.17.41 (27 Feb 2006 13:16:50 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news1.google.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail