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