WM_DDE_ACK

The WM_DDE_ACK message notifies a DDE application of the receipt and processing of a WM_DDE_POKE, WM_DDE_EXECUTE, WM_DDE_DATA, WM_DDE_ADVISE, WM_DDE_UNADVISE, or WM_DDE_INITIATE message, and in some cases, of a WM_DDE_REQUEST message.

WM_DDE_ACK 
// Response to WM_DDE_INITIATE 
wParam = (WPARAM) hwnd;          // handle of posting application 
lParam = MAKELPARAM(aApp, aTopic) // application and topic atoms 
 
// Response to WM_DDE_EXECUTE 
wParam = (WPARAM) hwnd;         // handle of posting application 
lParam = (LPARAM) lPackedVal;   // packed status flags and data handle 
 
// Response to all other messages 
wParam = (WPARAM) hwnd;         // handle of posting application 
lParam = (LPARAM) lPackedVal;   // packed status flags and item 
 

Parameters

When responding to WM_DDE_INITIATE:
hwnd
Value of wParam. Handle to the server window posting the message.
aApp
Value of the low-order word of lParam. Contains an atom that identifies the replying application.
aTopic
Value of the high-order word of lParam. Contains an atom that identifies the topic for which a conversation is being established.
When responding to WM_DDE_EXECUTE:
hwnd
Value of wParam. Handle to the server window posting the message.
lPackedVal
Value of lParam. The component parameters that are packed into lPackedVal are extracted by calling the UnpackDDElParam function. The low-order word is wStatus. The high-order word is the same hCommands that was received in the WM_DDE_EXECUTE message.
Parameter Description
wStatus Specifies a DDEACK structure containing a series of flags that indicate the status of the response.
hCommands Handle to a global memory object that contains the command string.

When replying to all other messages:
hwnd
Value of wParam. Handle to the client or server window posting the message.
lPackedVal
Value of lParam. The component parameters that are packed into lPackedVal are extracted by calling the UnpackDDElParam function. The low-order word is wStatus. The high-order word is aItem.
Parameter Description
wStatus Specifies a DDEACK structure containing a series of flags that indicate the status of the response.
aItem Contains a global atom that identifies the name of the data item for which the response is sent.

Remarks

Posting

Except in response to the WM_DDE_INITIATE message, the application posts the WM_DDE_ACK message by calling the PostMessage function, not by calling the SendMessage function. When responding to WM_DDE_INITIATE, the application sends the WM_DDE_ACK message by calling SendMessage. In this case, neither the application-name atom nor the topic-name atom should be NULL (even if the WM_DDE_INITIATE message specified NULL atoms).

When acknowledging any message with an accompanying aItem atom, the application posting WM_DDE_ACK can either reuse the aItem atom that accompanied the original message, or it can delete it and create a new one.

When acknowledging WM_DDE_EXECUTE, the application that posts WM_DDE_ACK should reuse the global memory object identified in the original WM_DDE_EXECUTE message.

All posted WM_DDE_ACK messages must create or reuse the lPackedVal parameter by calling the PackDDElParam function or the ReuseDDElParam function.

If an application has initiated the termination of a conversation by posting WM_DDE_TERMINATE and is awaiting confirmation, the waiting application should not acknowledge (positively or negatively) any subsequent messages sent by the other application. The waiting application should delete any atoms or shared memory objects received in these intervening messages. Memory objects should not be freed if the fRelease flag is set to FALSE in WM_DDE_POKE, and WM_DDE_DATA messages.

Receiving

The application that receives a WM_DDE_ACK message should delete all atoms accompanying the message. If the application receives a WM_DDE_ACK in response to a message with an accompanying hData object, and the object was sent with the fRelease flags set to FALSE, the application is responsible for deleteing the hData object.

If the application receives a negative WM_DDE_ACK message posted in reply to a WM_DDE_ADVISE message, the application should delete the global memory object posted with the original WM_DDE_ADVISE message (in hOptions). If the application receives a negative WM_DDE_ACK message posted in reply to a WM_DDE_DATA, WM_DDE_POKE, or WM_DDE_EXECUTE message, the application should delete the global memory object posted with the original WM_DDE_DATA, WM_DDE_POKE, or WM_DDE_EXECUTE message (in hCommands).

The application that receives a posted WM_DDE_ACK message must free the lPackedVal parameter by using the FreeDDElParam function.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in dde.h.

See Also

Dynamic Data Exchange Overview, Dynamic Data Exchange Messages, DDEACK, FreeDDElParam, PackDDElParam, PostMessage, ReuseDDElParam, SendMessage, UnpackDDElParam, WM_DDE_ADVISE, WM_DDE_DATA, WM_DDE_EXECUTE, WM_DDE_INITIATE, WM_DDE_POKE, WM_DDE_REQUEST, WM_DDE_TERMINATE, WM_DDE_UNADVISE