Modifier

Partager via


WM_DDE_DATA message

A Dynamic Data Exchange (DDE) server application posts a WM_DDE_DATA message to a DDE client application to pass a data item to the client or to notify the client of the availability of a data item.

To post this message, call the PostMessage function with the following parameters.

#define WM_DDE_DATA        0x03E05

Parameters

wParam

A handle to the server window posting the message.

lParam

The low-order word is a handle to a global memory object containing a DDEDATA structure with the data and additional information. The handle should be set to NULL if the server is notifying the client that the data-item value has changed during a warm data link. A warm link is established by the client sending a WM_DDE_ADVISE message with the fDeferUpd bit set.

The high-order word contains an atom that identifies the data item for which the data or notification is sent.

Remarks

Posting

The server application allocates the global memory object using the GlobalAlloc function. It allocates the atom using the GlobalAddAtom function.

The server must create or reuse the WM_DDE_DATA lParam parameter by calling the PackDDElParam function or the ReuseDDElParam function.

If the receiving (client) application responds with a negative WM_DDE_ACK message, the posting (server) application must delete the global memory object; otherwise, the client must delete the object after extracting its contents by calling the UnpackDDElParam function.

If the server application sets the fRelease member of the DDEDATA structure to FALSE, the server is responsible for deleting the object upon receiving either a positive or negative acknowledgment.

The server application should not set both the fAckReq and fRelease members of the DDEDATA structure to FALSE. If both members are set to FALSE, it is impossible for the server to determine when to delete the object.

Receiving

If fAckReq is TRUE, the client application should post the WM_DDE_ACK message to respond positively or negatively. When posting WM_DDE_ACK, the client can either reuse the atom, or it can delete it and create a new one.

The client must create or reuse the WM_DDE_ACK lParam parameter by calling the PackDDElParam function or the ReuseDDElParam function.

If fAckReq is FALSE, the client application should delete the atom.

If the posting application specified global memory object as NULL, the receiving application can request the server to send the data by posting a WM_DDE_REQUEST message.

After processing a WM_DDE_DATA message in which the global memory object is not NULL, the client should free the object, unless one of the following conditions is true:

  • The fRelease member is FALSE.
  • The fRelease member is TRUE, but the client application responds with a negative WM_DDE_ACK message.

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Dde.h (include Windows.h)

See also

Reference

DDEDATA

FreeDDElParam

GlobalAddAtom

PackDDElParam

PostMessage

ReuseDDElParam

SendMessage

UnpackDDElParam

WM_DDE_ACK

WM_DDE_ADVISE

WM_DDE_POKE

WM_DDE_REQUEST

Conceptual

About Dynamic Data Exchange