Results 1 to 2 of 2

Thread: How to use messages to communicate with external aplications ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Posts
    2

    How to use messages to communicate with external aplications ?

    HI! I am new to this API subject...Basically I need to use windows messages to comunicate with an external application which I control using VB6 and a script file. I need to send messages such as "CONTINUE" or wait for a message from the application saying something like "OK". I am a bit confuse with the message handler for an external application. The message should be sent to a particular window (what is it for an aplication) or should just be broadcasted to all the windows . I take it I need to register the messages i want to receive/send?
    And use funtions sendmessage and getmessage ?

    Well any help on this I really appreciate.

    Thanks

    Marco

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    You can use the WM_USER messge
    WM_USER
    The WM_USER constant is used by applications to help define private messages, usually of the form WM_USER+X, where X is an integer value.

    #define WM_USER 0x0400

    Remarks
    There are five ranges of message numbers:

    Range Meaning
    0 through WM_USER – 1 Messages reserved for use by the system.
    WM_USER through 0x7FFF Integer messages for use by private window classes.
    WM_APP through 0xBFFF Messages available for use by applications.
    0xC000 through 0xFFFF String messages for use by applications.
    Greater than 0xFFFF Reserved by the system for future use.


    Message numbers in the first range (0 through WM_USER – 1) are defined by the system. Values in this range that are not explicitly defined are reserved for future use by the system.

    Message numbers in the second range (WM_USER through 0x7FFF) can be defined and used by an application to send messages within a private window class. These values cannot be used to define messages that are meaningful throughout an application, because some predefined window classes already define values in this range. For example, predefined control classes such as BUTTON, EDIT, LISTBOX, and COMBOBOX may use these values. Messages in this range should not be sent to other applications unless the applications have been designed to exchange messages and to attach the same meaning to the message numbers.

    Message numbers in the third range (0x8000 through 0xBFFF) are available for application to use as private messages. Message in this range do not conflict with system messages.

    Message numbers in the fourth range (0xC000 through 0xFFFF) are defined at run time when an application calls the RegisterWindowMessage function to retrieve a message number for a string. All applications that register the same string can use the associated message number for exchanging messages. The actual message number, however, is not a constant and cannot be assumed to be the same between different sessions.

    Message numbers in the fifth range (greater than 0xFFFF) are reserved for future use by the system.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

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