Results 1 to 6 of 6

Thread: How to Make Two Applictions Talk?

  1. #1

    Thread Starter
    Addicted Member MikeHost's Avatar
    Join Date
    Nov 2000
    Location
    Missouri
    Posts
    175

    How to Make Two Applictions Talk?

    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????
    <<<<>>>>

  2. #2
    Megatron
    Guest
    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
    VB Code:
    1. 'In a module
    2. Public Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Long
    3. Public WM_MYMESSAGE As Long
    4.  
    5. 'In Form_Load()
    6. WM_MYMESSAGE = RegisterWindowMessage("MyMessage")

    Method 2
    VB Code:
    1. 'In a Module
    2. Public Const WM_USER = &H400
    3. Public WM_MYMESSAGE As Long
    4.  
    5. 'In Form_Load()
    6. WM_MYMESSAGE = WM_USER + 100

  3. #3
    Registered User
    Join Date
    May 2001
    Location
    taizhou zheziang china
    Posts
    17

    sproll

    use DDE

  4. #4
    Registered User
    Join Date
    May 2001
    Location
    taizhou zheziang china
    Posts
    17

    sproll

    use DDE:

  5. #5
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    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?

  6. #6
    New Member
    Join Date
    Oct 2001
    Location
    Indore
    Posts
    9

    Red face

    Hi Folk

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


    sachin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width