PDA

Click to See Complete Forum and Search --> : How to Make Two Applictions Talk?


MikeHost
Aug 8th, 2001, 06:18 AM
Is there anyway to send a message from one application to another. In particular, I want one program to send a message to another to let the second application know where the first is in processing.

Does this make sense????

Megatron
Aug 8th, 2001, 07:12 AM
One method is to create a custom message that can be sent with SendMessage() or PostMessage(). There are 2 ways to do this. One is to call the RegisterWindowMessage() function, which will register a speific message globally. The other method is to create a custom message by adding a value to WM_USER. Then to capture this message, you need to subclass your window.

Pick one of the following methods, and add the code to both of your programs.

Method 1

'In a module
Public Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Long
Public WM_MYMESSAGE As Long

'In Form_Load()
WM_MYMESSAGE = RegisterWindowMessage("MyMessage")


Method 2

'In a Module
Public Const WM_USER = &H400
Public WM_MYMESSAGE As Long

'In Form_Load()
WM_MYMESSAGE = WM_USER + 100

sproll
Aug 12th, 2001, 10:45 PM
use DDE

sproll
Aug 12th, 2001, 10:45 PM
use DDE::o

shunt
Oct 3rd, 2001, 02:32 AM
Megatron,

What do you mean by "subclass the form"?

How will i know when the receiving application has received a message? Is there an event for this?

sachinmahajan
Oct 3rd, 2001, 03:06 AM
Hi Folk

can u give me example
how we can do using DDE
plz


sachin