Because DDE is a message-based protocol, it employs no special Win32 functions or libraries. All DDE transactions are conducted by passing certain defined DDE messages between the client and server windows.
There are nine DDE messages; the symbolic constants for these messages are defined in the DDE header file. Certain structures for the various DDE messages are also defined in this header file.
The following table summarizes the nine DDE messages.
Message | Description |
---|---|
WM_DDE_ACK | Acknowledges receiving or not receiving a message. |
WM_DDE_ADVISE | Requests the server application to supply an update or notification for a data item whenever it changes. This establishes a permanent data link. |
WM_DDE_DATA | Sends a data-item value to the client application. |
WM_DDE_EXECUTE | Sends a string to the server application, which is expected to process the string as a series of commands. |
WM_DDE_INITIATE | Initiates a conversation between the client and server applications. |
WM_DDE_POKE | Sends a data-item value to the server application. |
WM_DDE_REQUEST | Requests the server application to provide the value of a data item. |
WM_DDE_TERMINATE | Terminates a conversation. |
WM_DDE_UNADVISE | Terminates a permanent data link. |
An application calls SendMessage to issue the WM_DDE_INITIATE message or a WM_DDE_ACK message sent in response to WM_DDE_INITIATE. All other messages are sent by PostMessage. The first parameter of these calls is the handle of the receiving window; the second parameter contains the message to be sent; the third parameter identifies the sending window; and the fourth parameter contains the message-specific arguments.