WM_DDE_EXECUTE

2.x

#include <dde.h>

WM_DDE_EXECUTE
wParam = (WPARAM) hwnd;                   /* handle of posting window */
lParam = MAKELPARAM(reserved, hCommands); /* commands to execute      */

A dynamic data exchange (DDE) client application posts a WM_DDE_EXECUTE message to a DDE server application to send a string to the server to be processed as a series of commands. The server application is expected to post a WM_DDE_ACK message in response.

Parameters

hwnd

Value of wParam. Identifies the sending window.

reserved

Value of the low-order word of lParam. Reserved; must be zero.

hCommands

Value of the high-order word of lParam. Identifies a global memory object containing the command(s) to be executed.

Return Value

This message does not return a value.

Comments

The command string is a null-terminated string, consisting of one or more opcode strings enclosed in single brackets ([ ]) and separated by spaces.

Each opcode string has the following syntax. The parameters list is optional.

opcode parameters

The opcode is any application-defined single token. It cannot include spaces, commas, parentheses, or quotation marks.

The parameters list can contain any application-defined value or values. Multiple parameters are separated by commas, and the entire parameter list is enclosed in parentheses. Parameters cannot include commas or parentheses except inside a quoted string. If a bracket or parenthesis character is to appear in a quoted string, it must be doubled—for example, “((”.

The following are valid command strings:

[connect][download(query1,results.txt)][disconnect]
[query("sales per employee for each district")]
[open("sample.xlm")][run("r1c1")]

Posting

The application posts the WM_DDE_EXECUTE message by calling the PostMessage function, not the SendMessage function.

The application allocates hCommands by calling the GlobalAlloc function with the GMEM_DDESHARE option.

When processing a WM_DDE_ACK message posted in reply to a WM_DDE_EXECUTE message, the application that posted the original WM_DDE_EXECUTE message must delete the hCommands object sent back in the WM_DDE_ACK message.

Receiving

The application posts the WM_DDE_ACK message to respond positively or negatively, reusing the hCommands object.

See Also

PostMessage, WM_DDE_ACK