WM_DDE_INITIATE

This message, sent by either a client or server application, initiates a conversation with applications responding to the specified application and topic names.

Upon receiving this message, all applications with names that match the aApplication application and that support the aTopic topic are expected to acknowledge it (see the WM_DDE_ACK message).

Parameters

wParam

Identifies the sending window.

lParam

Specifies the target application and the topic.

Argument Description

aApplication Low-order word of lParam. An atom that specifies the name of the application with which a conversation is requested. The application name may not contain slashes or backslashes. These characters are reserved for future use in network implementations. If the application name is NULL, a conversation with all applications is requested.
aTopic High-order word of lParam. An atom that specifies the topic for which a conversation is requested. If the topic is NULL, a conversation for all available topics is requested.

Comments

If the aApplication argument is NULL, any application may respond. If the aTopic argument is NULL, any topic is valid. Upon receiving a WM_DDE_INITIATE request with a null topic, an application is expected to send a WM_DDE_ACK message for each of the topics it supports.

Sending

Send the WM_DDE_INITIATE message by calling the SendMessage function, not the PostMessage function. Broadcast the message to all windows by setting the first parameter of SendMessage to -1, as shown:

SendMessage(-1, WM_DDE_INITIATE, hwndClient,

MAKELONG(aApp, aTopic));

If the application has already obtained the window handle of the desired server, it can send WM_DDE_INITIATE directly to the server window by passing the server's window handle as the first parameter of SendMessage.

Allocate aApplication and aTopic by calling GlobalAddAtom.

When SendMessage returns, delete the aApplication and aTopic atoms.

Receiving

To complete the initiation of a conversation, respond with one or more WM_DDE_ACK messages, where each message is for a separate topic. When sending WM_DDE_ACK message, create new aApplication and aTopic atoms; do not reuse the atoms sent with the WM_DDE_INITIATE message.