// 003_进程通讯_WM_COPYDATA_发送方.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <windows.h>
int main()
{
COPYDATASTRUCT cds = { 0 };
cds.dwData = 0x12345678;
cds.lpData = (LPVOID)L"哈哈哈";
cds.cbData = strlen((char*)cds.lpData) + 1;
HWND hWnd = FindWindow(NULL, L"WM_COPYDATA接收方");
SendMessage(hWnd, WM_COPYDATA, 0, (LPARAM)&cds);
}