Tab Key Support in IWebBrowser2 Control

I have a built-in IWebBrowser2 control using direct C ++ (windowed, not windowless), and when someone hits the Tab key to go between fields in the browser, it pushes focus from the web browser.

Any ideas on what I need to implement or what I could squint at?

Thanks!

+4
source share
2 answers

Accelerating keystrokes, such as a tab, are processed by the outline of the message before being sent. Since such a hook function needs to be called by the message contour - IOleInPlaceActiveObject :: TranslateAccelerator iirc. - give control the ability to do things with the keyboard on the keyboard.

+1
source

I solved this problem from the link below.

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(); } 
0
source

Source: https://habr.com/ru/post/1308917/


All Articles