AW: Omnis Webview external focus issue

DATAX AG, Florian Binder fb at
Wed Mar 11 11:08:31 EDT 2015

Hi Kelly,

i investigated your idea today. It seems that Omnis and the external don't get notified of any WM messages send to the webview. If the container containing the webview is focused through the usage of the tab key (and not the webview through a click), all events (WM_FOCUSEDCHANGED) are thrown and the focus of the entry field gets removed. I did succeed in removing the caret with WNDdestroyCaret() and WNDsetCapture() but a click on a button is still necessary for Omnis to regain focus. A WNDreleaseCapture() is not possible as I didn't find a way to get notified when the user clicks inside an entry field.

Any ideas?

Mit freundlichen Gruessen
DATAX AG Unternehmensberatung

Florian Binder
DATAX AG Unternehmensberatung
Aixheimer Strasse 12
70619 Stuttgart
Fon: +49 711 47667-0
Fax: +49 711 47667-29
fb at
Vorstand: Christian Hirzel (Vorstandsvorsitzender), Jakob Hirzel
Vorsitzender des Aufsichtsrats: Herbert Graef
Amtsgericht Stuttgart HRB 13 127

-----Ursprüngliche Nachricht-----
Von: omnisdev-en-bounces at [mailto:omnisdev-en-bounces at] Im Auftrag von Kelly Burgess
Gesendet: Freitag, 6. März 2015 12:41
An: OmnisList
Betreff: Re: Omnis Webview external focus issue

Hi Florian,

Are you responding to WM_FOCUSCHANGED messages?

This message is generated when the input focus has been changed by Omnis. If a window displays an input caret, this is the time when the caret should be created or destroyed.

 focus - Value of wParam. If zero, the window looses the input focus. If 1 the window receives the input focus.

An external component should return non-zero if it creates or destroys the caret; otherwise, it should return zero.

The discussion of that message in the HWND reference shows an example response making calls to WNDcreateCaret, WNDsetCaretPos, WNDshowCaret and WNDdestroyCaret.  So maybe if you did all of that except the WNDshowCaret, it would be enough to remove the caret from the previously focused object.

WNDsetCapture and WNDreleaseCapture are worth investigating.  WNDsetCapture "sets the mouse or key capture to the given window. With the mouse or key capture set, all mouse and key input is directed to that window, regardless of whether the cursor is over that window or the window has the focus. Only one window can have the mouse capture or key capture at any one time."  So maybe calling one of these in response to WM_FOCUSCHANGED would help.

Manage your list subscriptions at

More information about the omnisdev-en mailing list