Get browser in focus when mouse over it

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Get browser in focus when mouse over it

Postby silver » Tue Apr 28, 2015 6:40 am

Hello

After loading a page inside a cef browser, you cannot scroll unless you click somewhere on the page or call cefhost->SendFocusEvent(true).

How to bring the cef browser automatically in focus when the mouse is brought over it.
Basically I don't want to click first to be able to scroll.
User avatar
silver
Techie
 
Posts: 48
Joined: Tue Feb 24, 2015 5:39 am

Re: Get browser in focus when mouse over it

Postby magreenblatt » Wed Apr 29, 2015 1:33 pm

What OS and CEF version?
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Get browser in focus when mouse over it

Postby silver » Thu Apr 30, 2015 12:42 am

magreenblatt wrote:What OS and CEF version?


Windows 7 64bit, CEF3 latest.
User avatar
silver
Techie
 
Posts: 48
Joined: Tue Feb 24, 2015 5:39 am

Re: Get browser in focus when mouse over it

Postby magreenblatt » Thu Apr 30, 2015 5:57 am

Use GetCursorPos and WindowFromPoint to get the browser HWND, and then call SetFocus.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Get browser in focus when mouse over it

Postby silver » Sat May 09, 2015 6:31 am

magreenblatt wrote:Use GetCursorPos and WindowFromPoint to get the browser HWND, and then call SetFocus.


OK that worked.
User avatar
silver
Techie
 
Posts: 48
Joined: Tue Feb 24, 2015 5:39 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 68 guests