开发者

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

开发者 https://www.devze.com 2022-12-27 04:33 出处:网络
I\'m using WinForms, and I\'m trying to get SetNotifyWindowMessage() to send a message to the WndProc, but it does not do so.

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

精彩评论

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