Tab key support in an IWebBrowser2 control

元气小坏坏 提交于 2019-11-29 14:30:35

Accelerator keystrokes like tab are handled by the message loop before being dispatched. As such a hook function needs to be called by a message loop - IOleInPlaceActiveObject::TranslateAccelerator iirc. - to give the control the chance to do keyboard navigation type things.

I solved this problem by below link.

http://social.msdn.microsoft.com/Forums/en-US/ieextensiondevelopment/thread/1f485dc6-e8b2-4da7-983f-ca431f96021f/

IWebBrowser2* iBrowser;
IOleInPlaceActiveObject* pIOIPAO;

hr = mpWebObject->QueryInterface(IID_IWebBrowser2,(void**)&iBrowser);
if ( SUCCEEDED(hr) )
{
iBrowser->QueryInterface(IID_IOleInPlaceActiveObject,(void**)&pIOIPAO);
          if ( SUCCEEDED(hr) )
          {
          pIOIPAO->TranslateAccelerator(msg);
                    pIOIPAO->Release();
          }
          iBrowser->Release();

}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!