WM_COPYDATA message

An application sends the WM_COPYDATA message to pass data to another application.

#define WM_COPYDATA                     0x004A

Parameters

wParam

A handle to the window passing the data.

lParam

A pointer to a COPYDATASTRUCT structure that contains the data to be passed.

Return value

If the receiving application processes this message, it should return TRUE; otherwise, it should return FALSE.

Remarks

The data being passed must not contain pointers or other references to objects not accessible to the application receiving the data.

While this message is being sent, the referenced data must not be changed by another thread of the sending process.

The receiving application should consider the data read-only. The lParam parameter is valid only during the processing of the message. The receiving application should not free the memory referenced by lParam. If the receiving application must access the data after SendMessage returns, it must copy the data into a local buffer.

Examples

For an example, see Using Data Copy.

Requirements

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

See also

Reference

SendMessage

COPYDATASTRUCT