QA: Why does not keyboard navigation work with HTML control?
Yaroslav Goncharov (yaroslav@softspb.com), February 05, 2003.
Question
HTML control does not respond to keyboard events in my Pocket PC application.
How can I enable keyboard navigation in the HTML control?
Answer
There are 2 aspects that can disable keyboard navigation: an invalid initial focus
and a dialog-based parent.
A dialog-based parent consumes keyboard events and does not give a chance to the
HTML control to get them. There are several possibilities to fix it, but for the simplest solution
use a generic parent window instead of a dialog.
Another interesting point is keyboard focus. The HTML control consists from 2 windows.
You should set a focus to the inner window to enable keyboard navigation. A good place
to do it is the end of the parent window's WM_CREATE handler.
HWND hWndInternal = GetWindow(hwndHtmlCtrl, GW_CHILD);
SetFocus(hWndInternal);
Related resources:
-
http://www.pocketpcdn.com/sections/html.html
Section: HTML in Programs
-
http://www.pocketpcdn.com/articles/htmldialog.html
Article: HTML based dialog for Pocket PC
-
http://www.pocketpcdn.com/libraries/sthtmldialog.html
Library: STHtmlDialog
-
http://www.pocketpcdn.com/libraries/webbrowserce.html
Control: WebBrowserCE
-
http://www.pocketpcdn.com/libraries/embrosix.html
Control: handSmart Embrosix Pocket PC Browser ActiveX
- http://www.microsoft.com/mobile/developer/technicalarticles/htmlviewer.asp
Article: Developing in C++ with the HTML Viewer Control
- http://www.microsoft.com/mobile/developer/technicalarticles/offlineweb.asp
Article: Offline Web-Based Applications
- http://www.devbuzz.com/content/zinc_eVB_html_viewer_ctrl_II_pg1.asp
Article: Saddling the HTML View Control Part II / Catch Those Messages
- http://www.devbuzz.com/content/zinc_eVB_html_viewer_ctrl_pg1.asp
Article: Saddling the HTML View Control from eVB