SendMessage Always Returns ZERO?

Why does Windows SendMessage () always return ZERO, even message delivery is successful? Is there a way to check for message delivery failure using SendMessage ()?

EDIT

Forgot to mention that I use SendMessage () inside the C ++ DLL

LRESULT result = ::SendMessage(hwndOtherWindow,WM_COPYDATA, NULL/*(WPARAM)this->GetSafeHwnd()*/,(LPARAM)&structCDS);

"result" is always zero :(, but the message delivers to another window successfully

EDIT

BOOL CDlg::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct)
{
    return /*CDialog::OnCopyData(pWnd, pCopyDataStruct)*/ true;  //true is the trick
 }
+3
source share
1 answer

Returning zero from SendMessage for WM_COPYDATA means that the target application did not process the message (FALSE = 0).

, (.. ), SendMessage .

, , , , WM_COPYDATA.

+2

Source: https://habr.com/ru/post/1733639/


All Articles