Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This message is sent when an application passes data to another application.

Syntax

WM_COPYDATA 
wParam = (WPARAM)(HWND) 
hwnd; 

lParam = (LPARAM)(PCOPYDATASTRUCT) 
pcds;

Parameters

hwnd

Handle to the window passing the data.

pcds

Pointer to a COPYDATASTRUCTstructure 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

An application must use the SendMessagefunction to send this message, not the PostMessagefunction.

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 pcdsparameter is valid only during the processing of the message. The receiving application should not free the memory referenced by pcds. If the receiving application must access the data after SendMessagereturns, it must copy the data into a local buffer.

For Windows CE 1.0 through 2.11, pcdscannot be a global or static variable. This causes the COPYDATASTRUCTstructure to be corrupt when it reaches its destination. Later versions of Windows Embedded CE do not have this restriction.

Requirements

Header winuser.h
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also