WM_DDE_EXECUTE

This message, posted by a client application, sends a string to a server application to be processed as a series of commands. The server application is expected to post a WM_DDE_ACK message in response.

Parameter

wParam

Identifies the sending window.

lParam

A handle that identifies a global memory object containing the command(s) to be executed.

Comments

The command string is null-terminated. The command string should adhere to the syntax shown below. Optional syntax elements are enclosed in double brackets ([[ ]]); single brackets ([ ]) are a syntax element.

[opcodestring] [[ [opcodestring] ]] . . .

The opcodestring uses the following syntax:

opcode[[ (parameter [[ ,parameter ]] . . . ) ]]

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

The parameter is any application-defined value. Multiple parameters are separated by commas, and the entire parameter list is enclosed in parentheses. The parameter may not 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: ((.

The following examples show valid command strings:

[connect][download(query1,results.txt)][disconnect]

[query("sales per employee for each district")]

[open("sample.xlm")][run("r1c1")]

Posting

Post the WM_DDE_EXECUTE message by calling the PostMessage function, not SendMessage.

Allocate hCommands by calling the GlobalAlloc function with the GMEM_DDE_SHARE option.

When processing WM_DDE_ACK sent in reply to WM_DDE_EXECUTE, the sender of the original WM_DDE_EXECUTE message must delete the hCommands object sent back in the WM_DDE_ACK message.

Receiving

Post the WM_DDE_ACK message to respond positively or negatively, reusing the hCommands object.