scratchpad - How to register TSF with Windows Desktop speech engine -
here code initialize , register tsf:
::oleinitialize(null); hresult hr=cocreateinstance(clsid_tf_threadmgr,null,clsctx_inproc_server,iid_itfthreadmgr,(void **)&pthreadmgr); if (failed(hr) || pthreadmgr==null) return; hr=pthreadmgr->activate(&clientid); if (failed(hr)) return; hr=pthreadmgr->createdocumentmgr(&pdocumentmgr); if (failed(hr) || pdocumentmgr==null) return; ptextstore=new ctextstore(); // create itextstoreacp store hr=pdocumentmgr->createcontext(clientid,0,reinterpret_cast<itextstoreacp *>ptextstore,&pcontext,&editcookie); if (failed(hr) || pcontext==null) goto end; hr=pdocumentmgr->push(pcontext); if (failed(hr)) return;
at end of code, textstore interface gets gettextview,getstatus , getwnd calls. however, no calls received settext() or other methods when speak microphone. default dictation scratchpad shows instead. don't want scratchpad show up. need text routed textstore. need register textstoreacp interface speech engine? missing here? ideas?
the application window needs specified focus window document manager:
pthreadmgr->associatefocus(hwnd, pdocumentmgr, &pprevdocumentmgr);
after call, tsf starts routing speech calls itextstoreacp interface.
Comments
Post a Comment