I'am developping a speech recognition application, all the code has been written correctly. However, SetNotifyWindowMessage would not send any message to the windows procedure
WM_RECOEVENT never get called
Code:
#define WM_RECOEVENT WM_USER+190
Code:
cpRecoCtx->SetNotifyWindowMessage( hWnd, WM_RECOEVENT, 0, 0 );
Code:
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
static HWND hEdit;
switch(uMsg) {
case WM_CREATE:
{
hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", WS_VISIBLE | WS_CHILD , 0, 0, 640, 400, hWnd, (HMENU)IDC_EDIT1, GetModuleHandle(NULL), NULL);
HWND bButton = CreateWindowEx(0, "BUTTON", "Start Speech Recognition", WS_VISIBLE | WS_CHILD, 0, 410, 640, 30, hWnd, (HMENU)ID_START_RECOG, GetModuleHandle(NULL), NULL);
//LaunchRecognition(hWnd);
}
break;
case WM_RECOEVENT:
{
WCHAR *pwszText = HandleEvent();
SetDlgItemText(hWnd, IDC_EDIT1, (char*)pwszText);
SetDlgItemText(hWnd, IDC_EDIT1, "\r\n");
}
break;
....
WM_RECOEVENT never get called