This message is sent when an application passes data to another application. WM_COPYDATA wParam = (WPARAM)(HWND) hwnd;
lParam = (LPARAM)(PCOPYDATASTRUCT) pcds;
Parameters
hwnd
Handle to the window passing the data.
pcds
Pointer to a COPYDATASTRUCT structure that contains the data to be passed. msdn不是很详细吗?
lParam = (LPARAM)(PCOPYDATASTRUCT) pcds;
Parameters
hwnd
Handle to the window passing the data.
pcds
Pointer to a COPYDATASTRUCT structure that contains the data to be passed. msdn不是很详细吗?
DWORD dwData;
DWORD cbData;
PVOID lpData;
} COPYDATASTRUCT;
Members
dwData
Specifies up to 32 bits of data to be passed to the receiving application.
cbData
Specifies the size, in bytes, of the data pointed to by the lpData member.
lpData
Long pointer to data to be passed to the receiving application. This member can be NULL.
一楼是指针好不好,我觉得可以,你试试
just do it
{
AfxMessageBox((LPCSTR)(pCopyDataStruct->lpData));/*利用对话框表示收到消息*/ return CWnd::OnCopyData(pWnd, pCopyDataStruct);
}
进程通信还有其他一些手段,相对来说比较麻烦,但局限性要比WM_COPYDATA小。当然你也可以两端都注册一个消息来通信。http://blog.csdn.net/scq2099yt/archive/2008/03/21/2202555.aspx