WM_DDE_POKE

2.x

#include <dde.h>

WM_DDE_POKE
wParam = (WPARAM) hwnd;             /* handle of posting window */
lParam = MAKELPARAM(hData, aItem);  /* data handle and item     */

A dynamic data exchange (DDE) client application posts a WM_DDE_POKE message to a server application. A client uses this message to request the server to accept an unsolicited data item. The server is expected to reply with a WM_DDE_ACK message indicating whether it accepted the data item.

Parameters

hwnd

Value of wParam. Specifies the handle of the window posting the message.

hData

Value of the low-order word of lParam. Identifies the data being posted. The handle identifies a global memory object that contains a DDEPOKE data structure. The DDEPOKE structure has the following form:

#include <dde.h>

typedef struct tagDDEPOKE {  /* ddepok */
    WORD  unused:13,
          fRelease:1,
          fReserved:2;
    short cfFormat;
    BYTE  Value[1];
} DDEPOKE;

For a full description of this structure, see Chapter 3, “Structures.”

aItem

Value of the high-order word of lParam. Specifies a global atom that identifies the data item being offered to the server.

Return Value

This message does not return a value.

Comments

Posting

The posting (client) application should do the following:

Use the PostMessage function to post the WM_DDE_POKE message.

Use the GlobalAlloc function with the GMEM_DDESHARE option to allocate memory for the data.

Use the GlobalAddAtom function to create the atom for the data item.

Delete the global memory object if the server application responds with a negative WM_DDE_ACK message.

Delete the global memory object if the client has set the fRelease member of the DDEPOKE structure to FALSE and the server responds with either a positive or negative WM_DDE_ACK.

Receiving

The receiving (server) application should do the following:

Post the WM_DDE_ACK message to respond positively or negatively. When posting WM_DDE_ACK, reuse the data-item atom or delete it and create a new one.

Delete the global memory object after processing WM_DDE_POKE unless either the fRelease flag was set to FALSE or the fRelease flag was set to TRUE but the server has responded with a negative WM_DDE_ACK message.

See Also

DDEPOKE, GlobalAlloc, PostMessage, WM_DDE_ACK, WM_DDE_DATA