Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Data Exchange
Data Copy
Data Copy Reference
Messages
 WM_COPYDATA Message
WM_COPYDATA Message

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

Syntax

To send this message, call the SendMessage function as follows.

lResult = SendMessage(     // returns LRESULT in lResult
   (HWND) hWndControl,     // handle to destination control
   (UINT) WM_COPYDATA,     // message ID
   (WPARAM) wParam,     // = (WPARAM) () wParam;
   (LPARAM) lParam     // = (LPARAM) () lParam;
);

Parameters

wParam
Handle to the window passing the data.
lParam
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.

For an example, see Using Data Copy.

Message Information

HeaderDeclared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1

See Also

SendMessage, COPYDATASTRUCT
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Value      Đonny   |   Edit   |  
WM_COPYDATA = &H4A
Flag as ContentBug
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker