得到相应窗口的句柄,发送消息(), 在利用oncopydata()接收就可以!A // Specifies data to be passed to the receiving application. CString csStr = L"hello"; stDataStruct.dwData = 0; // Specifies the size, in bytes, of the data pointed to by the lpData member. stDataStruct.cbData = 2 * csStr.GetLength(); // Pointer to data to be passed to the receiving application. This member can be NULL stDataStruct.lpData = csStr.GetBuffer( stDataStruct.cbData ); csStr.ReleaseBuffer(); ::SendMessage(m_hIPMProcess, WM_COPYDATA, NULL, ( LPARAM )&stDataStruct); B BOOL CMYMainFrm::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct) {
{
PCOPYDATASTRUCT lpcds;
hwndSending = (HWND)wParam;
lpcds = (PCOPYDATASTRUCT)lParam; if( lpcds->cbData>=6 && lpcds->lpData )
在利用oncopydata()接收就可以!A // Specifies data to be passed to the receiving application.
CString csStr = L"hello";
stDataStruct.dwData = 0;
// Specifies the size, in bytes, of the data pointed to by the lpData member.
stDataStruct.cbData = 2 * csStr.GetLength();
// Pointer to data to be passed to the receiving application. This member can be NULL
stDataStruct.lpData = csStr.GetBuffer( stDataStruct.cbData );
csStr.ReleaseBuffer();
::SendMessage(m_hIPMProcess, WM_COPYDATA, NULL, ( LPARAM )&stDataStruct);
B
BOOL CMYMainFrm::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct)
{