Re: HWND_BROADCAST

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Gary Nastrasio (noemail_at_please.com)
Date: 09/02/04


Date: Thu, 02 Sep 2004 14:21:35 -0400

You can't send pointers across processes because the pointer value in
process a (PA) has no meaning in process b (PB) because each process
exists in its own virtual address space. For example, PA can have a
stack data structure starting at 0x12345678, while PB can (and most
definitely will) have something completely different at its own
0x12345678 address. If you need your processes to communicate there are
a few methods you can use:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipc/base/interprocess_communications.asp

I can't help you with the WM_SETTEXT message though, MSDN says LPARAM is
a pointer to your string, which again is only valid to your current process.

HTH,

Gary.

Sada wrote:
> Hi All,
>
> I want to send pointers accross the process by using the
> Message HWND_BROADCAST.I read at many places that you
> cannot send the pointer accross the processes.I tried to
> send a simple string using the HWND_BROADCAST and using a
> registered message I am not able to get the String
> properly in another Process.But if iam using just
> WM_SETTEXT Message instead of userdefined message iam able
> to receive the String can anyone tell me whats the
> difference between the 2 messages.
> Also i would like to know if there is any way we can send
> pointers accross process a sample would be appreciated.
>
> thanks in advance
> cheer,
> Sadashiv



Relevant Pages

  • Re: Operator overloading in C
    ... All development of C as an independent language has ... making any changes or improvements to the standard ... The lack of a counted string data structure, ... Pointers can't be used for arg1 or arg2. ...
    (comp.std.c)
  • Re: get text from listbox
    ... Dim nCount As Long ... Dim Buffer As String ... The first character is the low byte of the low word of the DWORD item data ... To prove that these are pointers get the item data of the list items as ...
    (microsoft.public.vb.winapi)
  • Re: Comments requested: brief summary of C
    ... ``A char holds a single byte. ... ``A string is a contiguous sequence of characters terminated ... pointed to by city. ... pointers and arrays are often used ...
    (comp.lang.c)
  • Re: Another Understanding Pointers Question
    ... > string functions to test. ... Again, why increment j? ... a good use of pointers. ... darrell at cs dot toronto dot edu ...
    (comp.lang.c)
  • Re: get text from listbox
    ... The first character is the low byte of the low word of the DWORD item data ... addressing memory in a virtual address space of 2 GB (memory allocation ... To prove that these are pointers get the item data of the list items as ... string pointer; check it by reading some bytes from the memory to which the ...
    (microsoft.public.vb.winapi)