Page 1 of 1

Handling the ZoomPctAvailable event when zooming in/out using the mouse wheel.

Posted: Fri Nov 08, 2024 2:36 am
by ggamak
Since it is a non-English passport, I am posting the text using a translation.

Please understand even if the text is strange.

After using an old version for a long time, I updated to the latest version and confirmed that zooming in/out using the mouse wheel is possible.
Thank you.
However, the ZoomPctAvailable event does not occur when zooming in/out using the mouse wheel.
It occurs when IncZoomStep, DecZoomStep are executed.
I want the ZoomPctAvailable event to occur even when zooming in/out using the mouse wheel.

Re: Handling the ZoomPctAvailable event when zooming in/out using the mouse wheel.

Posted: Fri Nov 08, 2024 11:04 am
by salvadordf
Hi,

When an application uses a CEF browser in off-screen mode (OSR mode) then it can intercept all mouse events and then you can call TChromiumCore.IncZoomStep or TChromiumCore.DecZoomStep when the user moves the mouse wheel while pressing the CONTROL key.

In this case the application will trigger TChromiumCore.OnZoomPctAvailable event.

However, CEF browsers that don't use the OSR mode intercept all mouse events internally. In this case you would need to use a low level mouse hook with SetWindowsHookEx and WH_MOUSE_LL to intercept all WM_MOUSEWHEEL messages.

https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowshookexw