How to intercept pen and touch inputs on windows.
Posted: Tue Jul 07, 2020 10:08 pm
Recently, I want to intercept the user inputs(mouse, pen, touch inputs) on the CEF window.
What I doing now is, hook the WndProc in the child window(class name: Chrome_WidgetWin_0) of the browser window(via CefBrowserHost->GetWindowHandle()) when CefLifeSpanHandler::OnAfterCreated. But this not working well, all the input message just sent when mousebutton is down, otherwise message are sent to child window(class name: Chrome_RenderWidgetHostHWND) of which window I hooked WndProc.
I try also hook the real window(Chrome_RenderWidgetHostHWND) which receive user inputs message. But I don't get a right timing for that. When OnAfterCreated, that windows is not created yet. When WM_PARENTNOTIFY with WM_CREATE on Chrome_WidgetWin_0, the real window is not valid and can't hook the WndProc by ::SetWindowPtrLong yet.
Is there any notification about the Chrome_RenderWidgetHostHWND created? Or any suggestion about getting pen or touch inputs with othre ways?
What I doing now is, hook the WndProc in the child window(class name: Chrome_WidgetWin_0) of the browser window(via CefBrowserHost->GetWindowHandle()) when CefLifeSpanHandler::OnAfterCreated. But this not working well, all the input message just sent when mousebutton is down, otherwise message are sent to child window(class name: Chrome_RenderWidgetHostHWND) of which window I hooked WndProc.
I try also hook the real window(Chrome_RenderWidgetHostHWND) which receive user inputs message. But I don't get a right timing for that. When OnAfterCreated, that windows is not created yet. When WM_PARENTNOTIFY with WM_CREATE on Chrome_WidgetWin_0, the real window is not valid and can't hook the WndProc by ::SetWindowPtrLong yet.
Is there any notification about the Chrome_RenderWidgetHostHWND created? Or any suggestion about getting pen or touch inputs with othre ways?
- Code: Select all
window tree:
+-"My app"QWidget
+-"BrowserWindow"CefBrowserWindow
+-""Chrome_WidgetWin_0 // witch I current hooked
+-"Chrome Legacy Window"Chrome_RenderWidgetHostHWND // witch I try to hooked but without a proper timing
+-""Intermediate D3D Window