Board index » delphi » Windows Messaging - send messages between two applications

Windows Messaging - send messages between two applications

I wonder if there is somebody who may be able to offer me some assistance,

I have a 'icon tray' application which auto-detects for some hardware when
it is first connected to the serial port, this then launches the main
application software, at this point auto-detection is turned off on the
'icon tray' application.

What I am trying to do is to send a message to the 'icon tray' application
from the main application, just as it is closed down so the auto-detect
software is re-enabled.

So far I have registered a user defined message, which is correctly picked
up by both applications, but I can't seem to find out how to receive a
message having used  PostMessage(HWND_BROADCAST, wm_msg, 0, 0); (where
wm_msg is the registered message number) to send a message.

any ideas or locations of source material will be gratefully received

Rob. Peck
Development Engineer
para...@globalnet.co.uk

 

Re:Windows Messaging - send messages between two applications


To exchange data between applications you can use the WM_COPYDATA message
(see win32.hlp).

"Rob Peck" <para...@globalnet.co.uk> schreef in bericht
news:8jps0r$jv6$1@gxsn.com...

Quote
> I wonder if there is somebody who may be able to offer me some assistance,

> I have a 'icon tray' application which auto-detects for some hardware when
> it is first connected to the serial port, this then launches the main
> application software, at this point auto-detection is turned off on the
> 'icon tray' application.

> What I am trying to do is to send a message to the 'icon tray' application
> from the main application, just as it is closed down so the auto-detect
> software is re-enabled.

> So far I have registered a user defined message, which is correctly picked
> up by both applications, but I can't seem to find out how to receive a
> message having used  PostMessage(HWND_BROADCAST, wm_msg, 0, 0); (where
> wm_msg is the registered message number) to send a message.

> any ideas or locations of source material will be gratefully received

> Rob. Peck
> Development Engineer
> para...@globalnet.co.uk

Re:Windows Messaging - send messages between two applications


"Rob Peck" <para...@globalnet.co.uk> skrev i en meddelelse
news:8jps0r$jv6$1@gxsn.com...

Quote
> So far I have registered a user defined message, which is correctly picked
> up by both applications, but I can't seem to find out how to receive a
> message having used  PostMessage(HWND_BROADCAST, wm_msg, 0, 0); (where
> wm_msg is the registered message number) to send a message.

Use Application.OnMessage to look for it.

Finn Tolderlund

Other Threads