--- mstools/mfc/samples/ctrltest/paredit.cpp 2018/08/09 18:21:00 1.1.1.1 +++ mstools/mfc/samples/ctrltest/paredit.cpp 2018/08/09 18:24:50 1.1.1.2 @@ -122,8 +122,19 @@ void CParsedEdit::OnVScroll(UINT nSBCode void CParsedEdit::OnBadInput() { + // In the Win32 API, the WM_COMMAND message is packed differently. + // When using the Microsoft Foundation Classes this is hardly noticed, + // because of the ON_COMMAND macro and message maps. If you need + // to send a WM_COMMAND to a window, the packing is specific to the + // target: Win32 or Win16... + +#ifndef _NTWIN + if (GetParent()->SendMessage(WM_COMMAND, + GetDlgCtrlID(), MAKELONG(m_hWnd, PEN_ILLEGALCHAR)) != -1) +#else if (GetParent()->SendMessage(WM_COMMAND, - GetDlgCtrlID(), MAKELONG(m_hWnd, PEN_ILLEGALCHAR)) != -1) + MAKELONG(GetDlgCtrlID(), PEN_ILLEGALCHAR), (LPARAM)m_hWnd) != -1) +#endif { MessageBeep(-1); }