WM_COPYDATA
The WM_COPYDATA message is sent when an application passes data to another application. WM_COPYDATA
wParam = (WPARAM) (HWND) hwnd; // handle of sending window
lParam = (LPARAM) (PCOPYDATASTRUCT) pcds; // pointer to structure with data
Parameters
hwnd
Handle to the window passing the data.
pcds
Pointer to a COPYDATASTRUCT structure that contains the data to be passed.
Return Values
If the receiving application processes this message, it should return TRUE; otherwise, it should return FALSE.
MSDN上是这样说的,如果成功SendMessage应该返回TRUE,否则返回FALSE;可是我在实际测试,无论成功与否返回都是0 ,为什么呢?
The WM_COPYDATA message is sent when an application passes data to another application. WM_COPYDATA
wParam = (WPARAM) (HWND) hwnd; // handle of sending window
lParam = (LPARAM) (PCOPYDATASTRUCT) pcds; // pointer to structure with data
Parameters
hwnd
Handle to the window passing the data.
pcds
Pointer to a COPYDATASTRUCT structure that contains the data to be passed.
Return Values
If the receiving application processes this message, it should return TRUE; otherwise, it should return FALSE.
MSDN上是这样说的,如果成功SendMessage应该返回TRUE,否则返回FALSE;可是我在实际测试,无论成功与否返回都是0 ,为什么呢?
我还试了一下,我的接受进程返回3,SendMessage也返回3.
你看看是不是这样你的名字也很有意思,忍无可忍,哈哈,则无须在忍
现在改成了:BOOL __fastcall TFrm::OnCopyData(TMessage Msg)
接收到数据后,返回TRUE;但是发送端的SendMessage还是返回0,你用vc试的?难道vc和cb有这么大区别?
switch(message)
{
case WM_CREATE:
....
break;
case WM_COPYDATA:
a=0;//断点
return 4;
}