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.
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Handling the ZoomPctAvailable event when zooming in/out using the mouse wheel.
- salvadordf
- Posts: 4620
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Handling the ZoomPctAvailable event when zooming in/out using the mouse wheel.
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
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