Messages between Two CF Apps

  • Thread starter Thread starter Neelima Godugu
  • Start date Start date
N

Neelima Godugu

Could anybody provide sample code that illustrates exchanging messages
between two CF Applications.
Thanks
Neelima
 
The simplest method is to use a MessageWindow and the PosstMesssage API.
-Chris
 
Hi Chris,
Thanks for the suggestion.
I am trying to implement that. I have question when I use post message I
have to pass the Handle of the receiveing window to create the message.
Since I am trying to exchange messages between two different assemblies I
dont have access to the receiving window handle in the assembly that
actually is posting the message. How do I work around this. Or am I going
about it in the wrong way.
Thanks
Neelima
 
Or send the messages, which you'd register with RegisterWindowMessage() (you
have to P/Invoke this), to all top-level windows using HWND_BROADCAST...

Paul T.
 
Yes, that's my preferred method too. I've noticed you post after finally
writing a sample. <g>

The interesting problem is that at least on PPC2003 emulator
SendMessage(HWND_BROADCAST,...) sometimes hangs forever. I had to replace it
with PostMessage and waiting for about 100 msec, but I don't really like it
Typically a hang in Broadcast means that some window got stuck processing
it, but there was absolutely nothing running. Weird
 
Alex,
Thanks for your effort. I had just finished coding and testing just before
you posted your sample. But it was good to confirm that I was doing things
the right way by look at your code.
Thanks
Neelima
 
Back
Top