I'm using WinForms, and I'm trying to get SetNotifyWindowMessage() to send a message to the WndProc, but it does not do so.
The function call:
HRESULT initSAPI(HWND hWnd)
{
...
if(FAILED( g_cpRecoCtxt->SetNotifyWindowMessage( hWnd, WM_RECOEVENT, 0, 0 )))
MessageBoxW(hWnd, L"Error sending window message", L"SAPI Initialization Error", 0);
...
}
The WndProc:
LRESULT WndProc (HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
case WM_RECOEVENT:
ProcessRecoEvent(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
Note: initSAPI() is called on a mouse click event.