开发者

Why doesn't SAPI's ISpNotifySource::SetNotifyWindowMessage() send the notification to my WndProc()?

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 W开发者_如何学GoM_RECOEVENT:
      ProcessRecoEvent(hWnd);
      break;
   default:
      return DefWindowProc(hWnd, message, wParam, lParam);
}

Note: initSAPI() is called on a mouse click event.


Have you called ISpRecoContext::SetInterest as well? SetNotifyWindowMessage specifies what to do when an event occurs, but doesn't specify what events to listen for.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜