Sending msg with 'SendMessage'? 
Author Message
 Sending msg with 'SendMessage'?

Hello group,

    Is it possible to embed a message in "SendMessage"? i.e.

    CString str("This is a test");
    SendMessage(MyMsg,str,0);

 TIA,

Ray K.



Sun, 01 Jun 2003 23:35:07 GMT  
 Sending msg with 'SendMessage'?
Sure,
You probably want to cast it to a char* though.
        SendMessage(MyMsg,(LPARAM)(LPCTSTR)str,0)


Quote:
> Hello group,

>     Is it possible to embed a message in "SendMessage"? i.e.

>     CString str("This is a test");
>     SendMessage(MyMsg,str,0);

>  TIA,

> Ray K.



Mon, 02 Jun 2003 00:57:49 GMT  
 Sending msg with 'SendMessage'?

"Tom",

     Thanks, works just fine!


Quote:
> Sure,
> You probably want to cast it to a char* though.
>         SendMessage(MyMsg,(LPARAM)(LPCTSTR)str,0)



> > Hello group,

> >     Is it possible to embed a message in "SendMessage"? i.e.

> >     CString str("This is a test");
> >     SendMessage(MyMsg,str,0);

> >  TIA,

> > Ray K.



Mon, 02 Jun 2003 03:37:24 GMT  
 Sending msg with 'SendMessage'?

Quote:

>    Is it possible to embed a message in "SendMessage"? i.e.

Depends where you're sending it. If you cast a pointer to a string
into a WPARAM or an LPARAM you could put it into the message, sure,
but how would another process make sense of a pointer that's pointing
into your process address space ?

--
Bob Moore [WinSDK MVP]
http://www.mooremvp.freeserve.co.uk/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Do not reply via email unless specifically requested to do so.
Unsolicited email is NOT welcome and will go unanswered.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Mon, 02 Jun 2003 03:57:39 GMT  
 Sending msg with 'SendMessage'?
It will work within a process but not between processes.


Quote:
> "Tom",

>      Thanks, works just fine!



> > Sure,
> > You probably want to cast it to a char* though.
> >         SendMessage(MyMsg,(LPARAM)(LPCTSTR)str,0)



> > > Hello group,

> > >     Is it possible to embed a message in "SendMessage"? i.e.

> > >     CString str("This is a test");
> > >     SendMessage(MyMsg,str,0);

> > >  TIA,

> > > Ray K.



Tue, 01 Jul 2003 11:27:14 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. CAN'T SEND A MESSAGE TO a DIALOG CONTROL with SENDMESSAGE

2. Message sent when 'X'?

3. Sending 'Keep Alives'

4. Send and read msg like net send

5. Send & read msg like Net send

6. gui thread looses msg's after exception

7. struct's with SendMessage

8. SendMessage() doesn't return back to calling function after its execution

9. SendMessage(EN_CHANGE) doesn't work.

10. Need Help with SendMessage's LPARAM!

11. SmtpMail.Send error 'Could not access 'CDO.Message' object.'

12. '0', '1', '2', '3' ...???

 

 
Powered by phpBB® Forum Software